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

Re: ignore-line style



I wrote:

> Oliver Kiddle wrote:
> 
> > I use this style:
> > 
> > zstyle ':completion:*:*:(cat|diff|less|rm|vi):*' ignore-line true
> > 
> > So, filenames I've already mentioned are not offered for completion
> > with these commands. This is useful but there is a problem:
> > 
> > With diff, it is quite common to compare a file to another file with
> > the same name in a different directory but this style blocks completion
> > of the second file. e.g: diff file ../fi<tab>
> > It needs to include the `../' in the comparison against other words on
> > the line.
> 
> Yeah, I've stumbled over this, too, but didn't have the time to work
> on it. And what's even more irritating, for me it shows that `file' in 
> the list but doesn't complete to it.

Here is what seems to fix it. It was using _comp_ignore on every level 
it walked through, hence `file' matched.

This seems almost too simple to not have any other effects, but let's
try... (I'll leave it to Oliver to commit his patch).


Bye
  Sven

Index: Completion/Unix/Type/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/_path_files,v
retrieving revision 1.13
diff -u -r1.13 _path_files
--- Completion/Unix/Type/_path_files	2001/10/11 09:19:56	1.13
+++ Completion/Unix/Type/_path_files	2001/10/17 13:23:54
@@ -351,19 +351,19 @@
       elif [[ "$tmp1[1]" = */* ]]; then
         if [[ -n "$_comp_correct" ]]; then
           tmp2=( "$tmp1[@]" )
-          builtin compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp1:t}"
+          builtin compadd -D tmp1 "$matcher[@]" - "${(@)tmp1:t}"
 
           if [[ $#tmp1 -eq 0 ]]; then
             tmp1=( "$tmp2[@]" )
-	    compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp2:t}"
+	    compadd -D tmp1 "$matcher[@]" - "${(@)tmp2:t}"
           fi
         else
           tmp2=( "$tmp1[@]" )
-          compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp1:t}"
+          compadd -D tmp1 "$matcher[@]" - "${(@)tmp1:t}"
         fi
       else
         tmp2=( '' )
-        compadd -D tmp1 -F _comp_ignore "$matcher[@]" -a tmp1
+        compadd -D tmp1 "$matcher[@]" -a tmp1
       fi
 
       # If no file matches, save the expanded path and continue with

-- 
Sven Wischnowsky                    wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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