about summary refs log tree commit diff
path: root/Completion/Base
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base')
-rw-r--r--Completion/Base/Core/_all_labels2
-rw-r--r--Completion/Base/Core/_main_complete1
-rw-r--r--Completion/Base/Core/_next_label2
-rw-r--r--Completion/Base/Widget/_next_tags4
4 files changed, 9 insertions, 0 deletions
diff --git a/Completion/Base/Core/_all_labels b/Completion/Base/Core/_all_labels
index 9dda58131..e607d639d 100644
--- a/Completion/Base/Core/_all_labels
+++ b/Completion/Base/Core/_all_labels
@@ -24,6 +24,8 @@ else
 fi
 
 while comptags "-A$__prev" "$1" curtag __spec; do
+  (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }"
+  _tags_level=$#funcstack
   _comp_tags="$_comp_tags $__spec "
   if [[ "$curtag" = *[^\\]:* ]]; then
     zformat -f __descr "${curtag#*:}" "d:$3"
diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete
index a78d0ec42..c0216a942 100644
--- a/Completion/Base/Core/_main_complete
+++ b/Completion/Base/Core/_main_complete
@@ -23,6 +23,7 @@ local func funcs ret=1 tmp _compskip format nm call match min max i num\
       _matchers _matcher _c_matcher _matcher_num _comp_tags _comp_mesg  \
       mesg str context state line opt_args val_args curcontext="$curcontext" \
       _last_nmatches=-1 _last_menu_style _def_menu_style _menu_style sel \
+      _tags_level=0 \
       _saved_exact="${compstate[exact]}" \
       _saved_lastprompt="${compstate[last_prompt]}" \
       _saved_list="${compstate[list]}" \
diff --git a/Completion/Base/Core/_next_label b/Completion/Base/Core/_next_label
index ff9b658a1..64506d05a 100644
--- a/Completion/Base/Core/_next_label
+++ b/Completion/Base/Core/_next_label
@@ -6,6 +6,8 @@ __gopt=()
 zparseopts -D -a __gopt 1 2 V J x
 
 if comptags -A "$1" curtag __spec; then
+  (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }"
+  _tags_level=$#funcstack
   _comp_tags="$_comp_tags $__spec "
   if [[ "$curtag" = *[^\\]:* ]]; then
     zformat -f __descr "${curtag#*:}" "d:$3"
diff --git a/Completion/Base/Widget/_next_tags b/Completion/Base/Widget/_next_tags
index eaf7e3ace..c6d095482 100644
--- a/Completion/Base/Widget/_next_tags
+++ b/Completion/Base/Widget/_next_tags
@@ -34,6 +34,8 @@ _next_tags() {
     fi
 
     while comptags "-A$__prev" "$1" curtag __spec; do
+      (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }"
+      _tags_level=$#funcstack
       [[ "$_next_tags_not" = *\ ${__spec}\ * ]] && continue
       _comp_tags="$_comp_tags $__spec "
       if [[ "$curtag" = *[^\\]:* ]]; then
@@ -59,6 +61,8 @@ _next_tags() {
     zparseopts -D -a __gopt 1 2 V J x
 
     if comptags -A "$1" curtag __spec; then
+      (( $#funcstack > _tags_level )) && _comp_tags="${_comp_tags% * }"
+      _tags_level=$#funcstack
       [[ "$_next_tags_not" = *\ ${__spec}\ * ]] && continue
       _comp_tags="$_comp_tags $__spec "
       if [[ "$curtag" = *[^\\]:* ]]; then