zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _expand limitation
@ 2000-03-17 17:32 Oliver Kiddle
  2000-03-23  8:29 ` Let's obey our own development guide :-) Andrej Borsenkow
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2000-03-17 17:32 UTC (permalink / raw)
  To: Zsh workers

I just did vi *(w)<tab> and expected it to expand to the one writable
file in the directory. It didn't work though. The trouble is that
_expand tries to expand things by doing ${~exp}(N). This means that it
is in effect trying to expand *(w)(N) which isn't the same as *(wN). The
easiest solution I can think of is if _expand does setopt localoptions
nullglob though someone else may have a better idea. The patch adds
this.

Oliver

--- _expand.bak	Fri Mar 17 17:16:01 2000
+++ _expand	Fri Mar 17 17:17:48 2000
@@ -7,6 +7,8 @@
 # the expansions done produce no result or do not change the original
 # word from the line.
 
+setopt localoptions nullglob
+
 [[ _matcher_num -gt 1 ]] && return 1
 
 local exp word="$PREFIX$SUFFIX" sort expr expl subd suf=" "
@@ -42,7 +44,7 @@
 
 zstyle -s ":completion:${curcontext}:" glob expr &&
     [[ "${(e):-\$[$expr]}" -eq 1 ]] &&
-    exp=( ${~exp}(N) )
+    exp=( ${~exp} )
 
 # If we don't have any expansions or only one and that is the same
 # as the original string, we let other completers run.


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

end of thread, other threads:[~2000-03-23  8:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-17 17:32 PATCH: _expand limitation Oliver Kiddle
2000-03-23  8:29 ` Let's obey our own development guide :-) Andrej Borsenkow

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).