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/_complete10
1 files changed, 10 insertions, 0 deletions
diff --git a/Completion/Core/_complete b/Completion/Core/_complete
index 0f4d5ff4b..86ccc8c67 100644
--- a/Completion/Core/_complete
+++ b/Completion/Core/_complete
@@ -6,6 +6,15 @@
 
 local comp name
 
+# If we have a user-supplied context name, use only that.
+
+if [[ -n "$compcontext" ]]; then
+  comp="$_comps[$compcontext]"
+  [[ -z "$comp" ]] || "$comp"
+
+  return
+fi
+
 # An entry for `-first-' is the replacement for `compctl -T'
 # Completion functions may set `_compskip' to any value to make the 
 # main loops stop calling other completion functions.
@@ -20,6 +29,7 @@ if [[ ! -z "$comp" ]]; then
   fi
 fi
 
+
 # For arguments and command names we use the `_normal' function.
 
 if [[ "$compstate[context]" = command ]]; then