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

Re: Problem with ignore-line and parenthesis



On Thu, 26 Aug 2004, Jesper Holmberg wrote:

> I have the following zstyle in my .zshrc:
> 
> zstyle ':completion:*:(rm|cp|mv):*' ignore-line yes
> 
> Filenames with parentheses in them seem to cause problems, though.

Filenames with any glob pattern in them would have problems, I think.  See 
if this does the right thing.

Index: Completion/Base/Core/_description
--- _description.~1.5.~	2003-08-10 09:00:12.000000000 -0700
+++ _description	2004-08-26 17:32:46.000000000 -0700
@@ -49,13 +49,13 @@
 
   zstyle -s ":completion:${curcontext}:$1" ignore-line hidden &&
     case "$hidden" in
-    true|yes|on|1) _comp_ignore=( "$_comp_ignore[@]" "$words[@]" );;
-    current)       _comp_ignore=( "$_comp_ignore[@]" "$words[CURRENT]" );;
+    true|yes|on|1) _comp_ignore=( "$_comp_ignore[@]" "${(q)words[@]}" );;
+    current)       _comp_ignore=( "$_comp_ignore[@]" "${(q)words[CURRENT]}" );;
     current-shown) [[ "$compstate[old_list]" = *shown* ]] &&
-                       _comp_ignore=( "$_comp_ignore[@]" "$words[CURRENT]" );;
+                       _comp_ignore=( "$_comp_ignore[@]" "${(q)words[CURRENT]}" );;
     other)         _comp_ignore=( "$_comp_ignore[@]"
-                                  "${(@)words[1,CURRENT-1]}"
-				  "${(@)words[CURRENT+1,-1]}" );;
+                                  "${(@q)words[1,CURRENT-1]}"
+				  "${(@q)words[CURRENT+1,-1]}" );;
     esac
 
   (( $#_comp_ignore )) && opts=( $opts -F _comp_ignore )



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