Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _expand limitation



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.



Messages sorted by: Reverse Date, Date, Thread, Author