diff options
Diffstat (limited to 'Completion/Zsh/Context')
-rw-r--r-- | Completion/Zsh/Context/_dynamic_directory_name | 30 | ||||
-rw-r--r-- | Completion/Zsh/Context/_parameter | 5 | ||||
-rw-r--r-- | Completion/Zsh/Context/_redirect | 3 |
3 files changed, 29 insertions, 9 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/_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} |