summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-02-26 16:35:55 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-02-26 16:35:55 +0000
commit48df213153610e302b94c866f869a5861e359349 (patch)
tree34bd8b346f2b7de612806e0710d4d143bb39be5e
parent194e4cac614cde3628293812f8edd285e593bfd1 (diff)
downloadzsh-48df213153610e302b94c866f869a5861e359349.tar.gz
zsh-48df213153610e302b94c866f869a5861e359349.tar.xz
zsh-48df213153610e302b94c866f869a5861e359349.zip
18299: allow _next_tags to work with nested tag loops
-rw-r--r--ChangeLog5
-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
5 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a61e083c8..822fc1b13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2003-02-26  Oliver Kiddle  <opk@zsh.org>
 
+	* 18299: Completion/Base/Core/_main_complete,
+	Completion/Base/Core/_all_labels, Completion/Base/Core/_next_label,
+	Completion/Base/Widget/_next_tags: allow _next_tags to work with
+	nested tag loops
+
 	* 18300: Completion/Unix/Command/_tar,
 	Completion/Unix/Type/_tar_archive: handle tar's -C option better
 
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