From 35b2633ad941966f5fca07b625a594a5b68c0fdb Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 15 Nov 1999 12:01:46 +0000 Subject: manual/8639 --- Completion/Core/_normal | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'Completion/Core/_normal') 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. -- cgit 1.4.1