diff options
Diffstat (limited to 'Functions')
-rw-r--r-- | Functions/Misc/allopt | 2 | ||||
-rw-r--r-- | Functions/Misc/zed | 3 | ||||
-rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_get_data_hg | 4 | ||||
-rw-r--r-- | Functions/VCS_Info/VCS_INFO_formats | 7 | ||||
-rw-r--r-- | Functions/VCS_Info/VCS_INFO_set | 2 | ||||
-rw-r--r-- | Functions/Zle/edit-command-line | 10 |
6 files changed, 19 insertions, 9 deletions
diff --git a/Functions/Misc/allopt b/Functions/Misc/allopt index 0c521f391..5d5d2885a 100644 --- a/Functions/Misc/allopt +++ b/Functions/Misc/allopt @@ -8,7 +8,7 @@ # Written by Sweth Chandramouli with hacks by Bart Schaefer. listalloptions () { - local OPT_NAME OPT_VALUE + local OPT_NAME OPT_VALUE IFS=$' \t\n' builtin set -o | while read OPT_NAME OPT_VALUE ; do if [[ ${OPT_NAME#no} != ${OPT_NAME} ]] ; then OPT_VALUE=${(L)${${OPT_VALUE:s/on/OFF}:s/off/on}} diff --git a/Functions/Misc/zed b/Functions/Misc/zed index 33bd1025b..f571daf5e 100644 --- a/Functions/Misc/zed +++ b/Functions/Misc/zed @@ -36,6 +36,9 @@ fi local curcontext=zed::: +# Matching used in zstyle -m: hide result from caller. +# Variables not used directly here. +local -a match mbegin mend zstyle -m ":completion:zed:*" insert-tab '*' || zstyle ":completion:zed:*" insert-tab yes diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg index d4030125c..cd5ef321d 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_hg @@ -55,8 +55,8 @@ if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" \ "check-for-changes" || hgid_args+=( -r. ) - local HGRCPATH - HGRCPATH="/dev/null" ${vcs_comm[cmd]} ${(z)hgid_args} 2> /dev/null \ + local HGPLAIN + HGPLAIN=1 ${vcs_comm[cmd]} ${(z)hgid_args} 2> /dev/null \ | read -r r_csetid r_lrev r_branch fi fi diff --git a/Functions/VCS_Info/VCS_INFO_formats b/Functions/VCS_Info/VCS_INFO_formats index 4d0dd75c2..e0e1dc738 100644 --- a/Functions/VCS_Info/VCS_INFO_formats +++ b/Functions/VCS_Info/VCS_INFO_formats @@ -34,7 +34,7 @@ hook_com[subdir_orig]="${hook_com[subdir]}" VCS_INFO_hook 'post-backend' -## description: +## description (for backend authors): # action: a string that signals a certain non-default condition in the # repository (like 'rebase-i' in git). If this in non-empty, # the actionformats will be used, too. @@ -49,6 +49,11 @@ VCS_INFO_hook 'post-backend' # should be provided. eg: # VCS_INFO_formats '' "${foobranch}" "${foobase}" '' '' '' "${foomisc}" +## description (vcs_info internals): +# This function is called by the backend with information about the repository, +# and (after some manipulations) populates the ${msgs} variable in preparation +# for calling VCS_INFO_set. + if [[ -n ${hook_com[action]} ]] ; then zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" actionformats msgs (( ${#msgs} < 1 )) && msgs[1]=' (%s)-[%b|%a]%u%c-' diff --git a/Functions/VCS_Info/VCS_INFO_set b/Functions/VCS_Info/VCS_INFO_set index e3f62ceef..0e5849147 100644 --- a/Functions/VCS_Info/VCS_INFO_set +++ b/Functions/VCS_Info/VCS_INFO_set @@ -2,6 +2,8 @@ ## Written by Frank Terbeck <ft@bewatermyfriend.org> ## Distributed under the same BSD-ish license as zsh itself. +# This function sets ${vcs_info_msg_<N>_} from ${msgs}. + setopt localoptions noksharrays NO_shwordsplit unset local -i i j diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line index 353f2609a..e17893e93 100644 --- a/Functions/Zle/edit-command-line +++ b/Functions/Zle/edit-command-line @@ -15,15 +15,15 @@ (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[2] # Open the editor, placing the cursor at the right place if we know how. - local editor=${${VISUAL:-${EDITOR:-vi}}} + local editor=( "${(@Q)${(z)${VISUAL:-${EDITOR:-vi}}}}" ) case $editor in (*vim*) integer byteoffset=$(( $#PREBUFFER + $#LBUFFER + 1 )) - ${=editor} -c "normal! ${byteoffset}go" -- $1;; + "${(@)editor}" -c "normal! ${byteoffset}go" -- $1;; (*emacs*) - local lines=( ${(f):-"$PREBUFFER$LBUFFER"} ) - ${=editor} +${#lines}:$((${#lines[-1]} + 1)) $1;; - (*) ${=editor} $1;; + local lines=( "${(@f):-"$PREBUFFER$LBUFFER"}" ) + "${(@)editor}" +${#lines}:$((${#lines[-1]} + 1)) $1;; + (*) "${(@)editor}" $1;; esac (( $+zle_bracketed_paste )) && print -r -n - $zle_bracketed_paste[1] |