diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-15 12:01:46 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-15 12:01:46 +0000 |
commit | 35b2633ad941966f5fca07b625a594a5b68c0fdb (patch) | |
tree | b54740d014e594ba5d81931cdcdb3387bcf9dfca /Completion/Core/_normal | |
parent | bb98460a01ce1f6c1e71f7e401f782c81b71486b (diff) | |
download | zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.gz zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.tar.xz zsh-35b2633ad941966f5fca07b625a594a5b68c0fdb.zip |
manual/8639
Diffstat (limited to 'Completion/Core/_normal')
-rw-r--r-- | Completion/Core/_normal | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/Completion/Core/_normal b/Completion/Core/_normal index 5d0a18406..f31e7e6fc 100644 --- a/Completion/Core/_normal +++ b/Completion/Core/_normal @@ -1,7 +1,7 @@ #autoload local comp command cmd1 cmd2 pat val name i ret=1 _compskip="$_compskip" -local _sub_context +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, @@ -16,19 +16,24 @@ local _sub_context command="$words[1]" if [[ CURRENT -eq 1 ]]; then + curcontext="${curcontext}:-command-" + comp="$_comps[-command-]" [[ -z "$comp" ]] || "$comp" && ret=0 return ret -elif [[ "$command[1]" == '=' ]]; then - eval cmd1\=$command - cmd2="$command[2,-1]" -elif [[ "$command" == */* ]]; then - cmd1="$command" - cmd2="${command:t}" else - cmd1="$command" - cmd2="$commands[$command]" + if [[ "$command[1]" == '=' ]]; then + eval cmd1\=$command + cmd2="$command[2,-1]" + elif [[ "$command" == */* ]]; then + cmd1="$command" + cmd2="${command:t}" + else + cmd1="$command" + cmd2="$commands[$command]" + fi + curcontext="${curcontext}:${cmd1}" fi # See if there are any matching pattern completions. |