diff options
| author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-16 11:44:57 +0000 |
|---|---|---|
| committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-16 11:44:57 +0000 |
| commit | d658d3e2bb1cdde7a58b244fac67a539f4c1cbad (patch) | |
| tree | fd352ec61b761d7eefffd70abac44e87c5aae8f5 /Completion/Core/_normal | |
| parent | avoid tilde- and parameter-completion in quotes (11407) (diff) | |
| download | zsh-d658d3e2bb1cdde7a58b244fac67a539f4c1cbad.tar zsh-d658d3e2bb1cdde7a58b244fac67a539f4c1cbad.tar.gz zsh-d658d3e2bb1cdde7a58b244fac67a539f4c1cbad.tar.bz2 zsh-d658d3e2bb1cdde7a58b244fac67a539f4c1cbad.tar.lz zsh-d658d3e2bb1cdde7a58b244fac67a539f4c1cbad.tar.xz zsh-d658d3e2bb1cdde7a58b244fac67a539f4c1cbad.tar.zst zsh-d658d3e2bb1cdde7a58b244fac67a539f4c1cbad.zip | |
fixed configuration of menu-selection with menu style; pseudo-context `-command-line-', handy for completion in vared (11408)
Diffstat (limited to 'Completion/Core/_normal')
| -rw-r--r-- | Completion/Core/_normal | 116 |
1 files changed, 86 insertions, 30 deletions
diff --git a/Completion/Core/_normal b/Completion/Core/_normal index 19da6d79b..52f0bb352 100644 --- a/Completion/Core/_normal +++ b/Completion/Core/_normal @@ -1,54 +1,110 @@ -#autoload +#compdef -command-line- -local comp cmd1 cmd2 pat val name +local comp command cmd1 cmd2 pat val name i ret=1 _compskip="$_compskip" +local curcontext="$curcontext" + +# If we get the option `-s', we don't reset `_compskip'. This ensures +# that a value set in the function for the `-first-' context is kept, +# but that we still use pattern functions when we were called form +# another completion function. + +[[ "$1" = -s ]] || _compskip='' # Completing in command position? If not we set up `cmd1' and `cmd2' as -# two strings we have search in the completion definition arrays (e.g. +# two strings we have to search in the completion definition arrays (e.g. # a path and the last path name component). -if [[ $CONTEXT == command ]]; then +command="$words[1]" +if [[ CURRENT -eq 1 ]]; then + curcontext="${curcontext%:*:*}:-command-:" + comp="$_comps[-command-]" - [[ -z "$comp" ]] || "$comp" "$@" - return -elif [[ "$COMMAND[1]" == '=' ]]; then - eval cmd1\=$COMMAND - cmd2="$COMMAND[2,-1]" -elif [[ "$COMMAND" == */* ]]; then |
