about summary refs log tree commit diff
path: root/Completion/Core/_complete
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Core/_complete')
-rw-r--r--Completion/Core/_complete7
1 files changed, 5 insertions, 2 deletions
diff --git a/Completion/Core/_complete b/Completion/Core/_complete
index 073212d0f..f351c7349 100644
--- a/Completion/Core/_complete
+++ b/Completion/Core/_complete
@@ -4,7 +4,10 @@
 # a normal completion function, but as one possible value for the
 # compconfig[completer] parameter.
 
-local comp name
+local comp name _tag_context="$_tag_context"
+
+[[ "$compstate[context]" != command || CURRENT -eq 1 ]] && 
+    _tag_context="-${compstate[context]:s/_/-/}-"
 
 # If we have a user-supplied context name, use only that.
 
@@ -36,7 +39,7 @@ else
   # Let's see if we have a special completion definition for the other
   # possible contexts.
 
-  comp="$_comps[-${compstate[context]:s/_/-/}-]"
+  comp="$_comps[$_tag_context]"
 
   # If not, we use default completion, if any.