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

Re: bug in 'rm' completion



>>>>> On November 9, 2009 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> You forgot the patch.

Hi Bart,

Duh.. see below.  It's just not considering the last word from the
line when generating the ignore pattern.  What I think is needed is to
generally remove the current word from incorporation into the ignore
pattern, but I don't know how to do that.  If I knew how to relate
$CURRENT to an element of $line that would do it.

greg


Index: Completion/Unix/Command/_rm
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_rm,v
retrieving revision 1.2
diff -u -r1.2 _rm
--- Completion/Unix/Command/_rm	23 Nov 2008 18:23:29 -0000	1.2
+++ Completion/Unix/Command/_rm	9 Nov 2009 15:49:39 -0000
@@ -33,7 +33,7 @@
 case $state in
   (file)
     declare -a ignored
-    ignored=(${line//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
+    ignored=(${line[1,-2]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})
     _files -F ignored && ret=0
     ;;
 esac



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