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

Re: Another _path_files bug?



On Feb 12,  2:22pm, Bart Schaefer wrote:
}
} } Obvious we'll need to find out if the original problem was more general,
} } in which case splitting off this case may work but isn't the right fix,
} } or if this has repercussions in other simple cases.
} 
} I haven't found any that break, but I don't have, e.g., any files with
} multibyte characters in their names handy to try.

Hmm, not sure if this is related, but (with "|" representing the cursor
position):

schaefer<522> ls ../z/T/M|
schaefer<522> ls ../zsh-|/T/M

I then hit TAB again to get a listing:

schaefer<522> ls ../zsh-|/T/M
Completing files
zsh-3.1.6/        zsh-4.3/          zsh-4.3-build/    zsh-4.3-dynamic/

So far so good.  Now hit TAB a third time to cycle through choices:

schaefer<522> ls ../zsh-3.1.6/T/M|
Completing files
zsh-3.1.6/        zsh-4.3/          zsh-4.3-build/    zsh-4.3-dynamic/

Oops, the cursor has moved all the way to the end of the word.  I think
it should have been positioned right after the 6.  Ah, says I to myself,
I bet ALWAYS_TO_END is involved here.  Let's try again; nope, no diff.

Ah, but if I BOTH unsetopt alwaystoend AND start the completion here:

schaefer<526> ls ../z|/T/M

Then it works:

schaefer<526> ls ../zsh-3.1.6|/T/M
Completing files
zsh-3.1.6/        zsh-4.3/          zsh-4.3-build/    zsh-4.3-dynamic/

This much I can reproduce starting from zsh -f plus compsys.  However,
with my usual matcher-list style added, the above works but the
following breaks:

schaefer<528> ls ../|z/T/M
schaefer<528> ls ../z.|

The style is:

zstyle ':completion:*' matcher-list '' 'r:|[-._,]=** r:|=**' \
  'm:{a-zA-Z}={A-Za-z} r:|[-._,]=** r:|=**' 'r:|[-._,]=** r:|=** l:|=*'

Any clue why that causes the path tail to get discarded?  In the case
with no matcher-list, the compadd at line 493 finds nine possible
matches for (../)(z/), but with the matcher-list it finds none.

The actual files:

../zsh-2.4          ../zsh-3.1.6        ../zsh-4.3-dynamic
../zsh-3.0.5        ../zsh-4.3          ../zsh-forge
../zsh-3.0.8-pre    ../zsh-4.3-build    ../zsh-tarball

(Above are the nine that fail the compadd with the matcher-list.  Below
are the possible completions of the whole path.)

../zsh-3.1.6/Test/Makefile.in     ../zsh-4.3/Test/Makefile.in
../zsh-4.3-build/Test/Makefile    ../zsh-4.3/Test/README
../zsh-4.3-dynamic/Test/Makefile



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