diff options
Diffstat (limited to 'Completion/Zsh/Context')
-rw-r--r-- | Completion/Zsh/Context/_dynamic_directory_name | 30 | ||||
-rw-r--r-- | Completion/Zsh/Context/_equal | 10 | ||||
-rw-r--r-- | Completion/Zsh/Context/_parameter | 5 | ||||
-rw-r--r-- | Completion/Zsh/Context/_redirect | 3 | ||||
-rw-r--r-- | Completion/Zsh/Context/_subscript | 3 |
5 files changed, 41 insertions, 10 deletions
diff --git a/Completion/Zsh/Context/_dynamic_directory_name b/Completion/Zsh/Context/_dynamic_directory_name index f449c3b12..5e0d73a8d 100644 --- a/Completion/Zsh/Context/_dynamic_directory_name +++ b/Completion/Zsh/Context/_dynamic_directory_name @@ -1,15 +1,29 @@ #autoload +local -a dirfuncs=( + ${(k)functions[zsh_directory_name]} + $zsh_directory_name_functions +) +local descr='dynamically named directory' -local func -integer ret=1 +if (( $#dirfuncs )); then + local -a expl + local -i ret + local func suf tag=dynamically-named-directories -if [[ -n $functions[zsh_directory_name] || \ - ${+zsh_directory_name_functions} -ne 0 ]] ; then - [[ -n $functions[zsh_directory_name] ]] && zsh_directory_name c && ret=0 - for func in $zsh_directory_name_functions; do - $func c && ret=0 + [[ $ISUFFIX != \]* ]] && + suf=-S] + + _tags "$tag" + while _tags; do + while _next_label "$tag" expl "$descr" $suf; do + for func in $dirfuncs; do + $func c && ret=0 + done + done + (( ret )) || break done return ret + else - _message 'dynamic directory name: implemented as zsh_directory_name c' + _message "${descr}: implement as zsh_directory_name c" fi diff --git a/Completion/Zsh/Context/_equal b/Completion/Zsh/Context/_equal index 58a415d56..5cdeea264 100644 --- a/Completion/Zsh/Context/_equal +++ b/Completion/Zsh/Context/_equal @@ -1,3 +1,11 @@ #compdef -equal- -_path_commands +local -a match mbegin mend + +if _have_glob_qual $PREFIX; then + compset -p ${#match[1]} + compset -S '[^\)\|\~]#(|\))' + _globquals +else + _path_commands +fi diff --git a/Completion/Zsh/Context/_parameter b/Completion/Zsh/Context/_parameter index 7e7788535..b08d665f5 100644 --- a/Completion/Zsh/Context/_parameter +++ b/Completion/Zsh/Context/_parameter @@ -1,3 +1,8 @@ #compdef -parameter- +if compset -P '*:'; then + _history_modifiers p + return +fi + _parameters -e diff --git a/Completion/Zsh/Context/_redirect b/Completion/Zsh/Context/_redirect index e6da5d115..520a7666e 100644 --- a/Completion/Zsh/Context/_redirect +++ b/Completion/Zsh/Context/_redirect @@ -15,4 +15,5 @@ if [[ "$CURRENT" != "1" ]]; then fi fi -_dispatch -redirect-,{${compstate[redirect]},-default-},${^strs} +_dispatch -redirect-,${compstate[redirect]},$_comp_command \ + -redirect-,{${compstate[redirect]},-default-},${^strs} diff --git a/Completion/Zsh/Context/_subscript b/Completion/Zsh/Context/_subscript index 25cedd193..67bad2862 100644 --- a/Completion/Zsh/Context/_subscript +++ b/Completion/Zsh/Context/_subscript @@ -98,6 +98,9 @@ elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then while _tags; do if _requested indexes; then ind=( {1..${#${(P)${compstate[parameter]}}}} ) + if [[ ${ind[-1]} -eq 0 ]]; then + ind=() + fi if zstyle -T ":completion:${curcontext}:indexes" verbose; then list=() for i in "$ind[@]"; do |