zsh-workers
 help / color / mirror / code / Atom feed
* Problem with completion of array indices
@ 2000-03-08 13:33 Oliver Kiddle
  2000-03-08 16:46 ` PATCH: " Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2000-03-08 13:33 UTC (permalink / raw)
  To: Zsh workers

This is with an unpatched 3.1.6-dev-19:

cd $fpath[1<tab>
1  -- /usr/local/share/zsh/site-functions   10   11   12   13   14

So where are the directories corresponding to 10, 11, 12, 13 and 14. As
far as I can tell, it isn't caused by anything in _subscript so it might
be something in compadd.

Oliver


^ permalink raw reply	[flat|nested] 2+ messages in thread

* PATCH: Re: Problem with completion of array indices
  2000-03-08 13:33 Problem with completion of array indices Oliver Kiddle
@ 2000-03-08 16:46 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2000-03-08 16:46 UTC (permalink / raw)
  To: Oliver Kiddle, Zsh workers

On Mar 8,  1:33pm, Oliver Kiddle wrote:
} Subject: Problem with completion of array indices
}
} This is with an unpatched 3.1.6-dev-19:
} 
} cd $fpath[1<tab>
} 1  -- /usr/local/share/zsh/site-functions   10   11   12   13   14
} 
} So where are the directories corresponding to 10, 11, 12, 13 and 14. As
} far as I can tell, it isn't caused by anything in _subscript so it might
} be something in compadd.

Here's a snippet of xtrace output (I comleted after path because my fpath
is not that long):

+_subscript:31> zformat -a list  --  1:~/bin 10:/usr/X11R6/bin 11:/bin 12:/usr/bin 13:/usr/rhs/bin 14:/usr/local/bin 15:/usr/X11R6/bin 16:/bin 17:/usr/bin 18:/usr/rhs/bin 19:/usr/local/bin
+_subscript:32> disp=( -d list )
+_subscript:37> [[  == ]* ]]
+_subscript:40> compadd -V -default- -S ] -d list - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

The doc for "compadd -d" says there should be one element of the array
(`list' in this case) for each word that follows the `-'.  Clearly that's
not the case here.

Index: Completion/Base/_subscript
===================================================================
@@ -24,9 +24,12 @@
       if zstyle -T ":completion:${curcontext}:indexes" verbose; then
         list=()
         for i in "$ind[@]"; do
-          [[ "$i" = ${PREFIX}*${SUFFIX} ]] &&
+          if [[ "$i" = ${PREFIX}*${SUFFIX} ]]; then
               list=( "$list[@]" 
 	             "${i}:$(print -D ${(P)${compstate[parameter]}[$i]})" )
+	  else
+	      list=( "$list[@]" '' )
+	  fi
         done
         zformat -a list ' -- ' "$list[@]"
 	disp=( -d list)

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-03-08 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-08 13:33 Problem with completion of array indices Oliver Kiddle
2000-03-08 16:46 ` PATCH: " Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).