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

Re: Slow completion



On Mar 6, 10:40pm, Thorsten Kampe wrote:
}
}     zstyle ':completion:*:-command-:*' ignored-patterns '*.dll' '*.exe'
} 
} This works fine for a "relative" completion like
} 
}     cada<TAB>
} 
} where cadaver/and/ cadaver.exe are returned.
} 
} But for an "absolute" completion like
} 
}     /usr/bin/cada<TAB>
} 
} there is only cadaver.exe returned which the above completion style 
} ignores. Since _ignored is at the end of my zstyle completer list, this 
} results in cadaver.exe only being completed after everything else has 
} been tried.

I'm not a regular cygwin user (in fact it's probably been 15 years since
I even touched a box with cygwin, now that I think about it) so you'll
have to (a) forgive any inaccuracies and (b) remind me how it is that
"cadaver" gets into the "relative" completion list in the first place,
since it is not a file on disk.

However, I think it's wrong to assert this is "inconsistent" completion.
You're not completing the same thing.  I'm pretty sure "cada" is being
completed for the "path-commands" group, while /usr/bin/cada is in the
"executables" (executable file or directory) group.  The latter uses
file completion rules, which are being applied quite consistently.
 
} Bash in contrast actually completes
} 
}     /usr/bin/cada<TAB>
} 
} to cadaver with completion_strip_exe set.

Well, yes.  Stripping the ".exe" off the matches when inserting into
the command line is a different operation from ignoring any matches
that contain the ".exe" suffix.

It might be possible to get the effect of completion_strip_exe with a
matcher style, something like (though I don't think this works)

    zstyle ':completion:*:-command-:*' matcher \
        'R:|.[eE][xX][eE]=.[eE][xX][eE]'

but I'm not really an expert with the matcher syntax and all the doc
examples are for left-anchored rather than right-anchored patterns.



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