about summary refs log tree commit diff
path: root/Completion/Core
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-03 11:52:00 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-05-03 11:52:00 +0000
commit0d6350d65a856b74000393dd4c4f5453e8801444 (patch)
treee272f79cc8508c5d563f471f0255f6a3e2c51483 /Completion/Core
parentd981fc1316617c6e4f8c7dcba339dd6b1da1279f (diff)
downloadzsh-0d6350d65a856b74000393dd4c4f5453e8801444.tar.gz
zsh-0d6350d65a856b74000393dd4c4f5453e8801444.tar.xz
zsh-0d6350d65a856b74000393dd4c4f5453e8801444.zip
remove backslashes before `$' in _expand when `substitute' is unset; fix for clearing end-of-list lines in menu-selection (11110)
Diffstat (limited to 'Completion/Core')
-rw-r--r--Completion/Core/_expand13
1 files changed, 8 insertions, 5 deletions
diff --git a/Completion/Core/_expand b/Completion/Core/_expand
index 712052b16..f75c626d3 100644
--- a/Completion/Core/_expand
+++ b/Completion/Core/_expand
@@ -35,11 +35,14 @@ exp=("$word")
 # changes quoted spaces, tabs, and newlines into spaces and protects
 # this function from aborting on parse errors in the expansion.
 
-{ zstyle -s ":completion:${curcontext}:" substitute expr ||
-  { [[ "$curcontext" = expand-word:* ]] && expr=1 } } &&
-    [[ "${(e):-\$[$expr]}" -eq 1 ]] &&
-    exp=( ${(f)"$(print -lR - ${(e)exp//\\[ 	
+if { zstyle -s ":completion:${curcontext}:" substitute expr ||
+     { [[ "$curcontext" = expand-word:* ]] && expr=1 } } &&
+       [[ "${(e):-\$[$expr]}" -eq 1 ]]; then
+  exp=( ${(f)"$(print -lR - ${(e)exp//\\[ 	
 ]/ })"} ) 2>/dev/null
+else
+  exp=( "${exp:s/\\\$/\$}" )
+fi
 
 # If the array is empty, store the original string again.
 
@@ -117,7 +120,7 @@ else
       if [[ -d "$i" && "$i" != */ ]]; then
         dir=( "$dir[@]" "$i" )
       else
-	normal=( "$dir[@]" "$i" )
+	normal=( "$normal[@]" "$i" )
       fi
     done
     (( $#dir ))    && compadd "$expl[@]" -UQ -qS/ - "$dir[@]"