about summary refs log tree commit diff
path: root/Completion/Core/_tags
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Core/_tags')
-rw-r--r--Completion/Core/_tags18
1 files changed, 15 insertions, 3 deletions
diff --git a/Completion/Core/_tags b/Completion/Core/_tags
index b74e70264..2dfa56f9d 100644
--- a/Completion/Core/_tags
+++ b/Completion/Core/_tags
@@ -1,5 +1,17 @@
 #autoload
 
+local prev
+
+# A `--' as the first argument says that we should tell comptags to use
+# the preceding function nesting level. This is only documented here because
+# if everythings goes well, users won't have to worry about it and should
+# not mess with it.
+
+if [[ "$1" = -- ]]; then
+  prev=-
+  shift
+fi
+
 if (( $# )); then
 
   # We have arguments: the tags supported in this context.
@@ -33,7 +45,7 @@ if (( $# )); then
 
   # Set and remember offered tags.
 
-  comptags -i "$curcontext" "$@"
+  comptags "-i$prev" "$curcontext" "$@"
 
   # Sort the tags.
 
@@ -80,11 +92,11 @@ if (( $# )); then
 
   # Return non-zero if at least one set of tags should be used.
 
-  comptags -T
+  comptags "-T$prev"
 
   return
 fi
 
 # The other mode: switch to the next set of tags.
 
-comptags -N
+comptags "-N$prev"