about summary refs log tree commit diff
path: root/Completion/Base/Widget/_next_tags
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Base/Widget/_next_tags')
-rw-r--r--Completion/Base/Widget/_next_tags4
1 files changed, 4 insertions, 0 deletions
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