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

Re: PATCH Re: squeeze-slashes false not working?



On 14 May 2011 20:31, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> This seems to work great in my zsh -f. My next project is working out
> why none of this helps with my zshrc loaded :). Thanks.

Okay, lucky for me it was the third zstyle from the top,
zstyle ':completion:*' accept-exact-dirs 'yes'

I do still want this set, but maybe it can be made not to consider the
empty string an exact dir?
This seems to do it, but I've no idea if it's sane. Sane is a strange
word to use in _path_files though.

--- a/Completion/Unix/Type/_path_files
+++ b/Completion/Unix/Type/_path_files
@@ -361,7 +361,8 @@ for prepath in "$prepaths[@]"; do
   skipped=
   cpre=

-  if [[ ( -n $accept_exact_dirs || -z $path_completion ) && \
+  if [[ ( ( -n $accept_exact_dirs && ${pre} != /* ) || \
+          -z $path_completion ) && \
         ${pre} = (#b)(*)/([^/]#) ]]; then
     # We've been told either that we can accept an exact directory prefix
     # immediately, or that path expansion is inhibited.  Try the longest

-- 
Mikael Magnusson



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