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

_files does not list files after foo/



Z(2):akr@is27e1u11% zsh -f         
is27e1u11% autoload -U compinit; compinit -D
is27e1u11% ls
ChangeLog      Doc            META-FAQ       README         acconfig.h     config.guess   config.status  install-sh
ChangeLog.3.0  Etc            Makefile       Src            aclocal.m4     config.h       config.sub     mkinstalldirs
Completion     Functions      Makefile.in    StartupFiles   aczsh.m4       config.h.in    configure      stamp-h
Config         INSTALL        Misc           Util           config.cache   config.log     configure.in   stamp-h.in
is27e1u11% gunzip ./<TAB>

After above operation, zsh does not list files in current directory.

OK, I know that the behaviour is intentional as:

_path_files:
|       # A little extra hack: if we were completing `foo/<TAB>' and `foo'
|       # contains no files, this will normally produce no matches and other
|       # completers might think that's it's their time now. But if the next
|       # completer is _correct or something like that, this will result in
|       # an attempt to correct a valid directory name. So we just add the
|       # original string in such a case so that the command line doesn't
|       # change but other completers still think there are matches.
| 
|       if [[ -z "$tpre$tsuf" && "$pre" = */ && -z "$suf" ]]; then
|         compadd -nQS '' - "$linepath$donepath$orig"
|         tmp4=-
|       fi

But it is confusing in this case.
I suppose that there should be the way to disable the hack.
-- 
Tanaka Akira



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