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

Re: 39093 erases variant with slashes (was: Re: Pattern matching with _files vs command line)



On Sep 11,  9:42am, Daniel Shahaf wrote:
} Subject: 39093 erases variant with slashes (was: Re: Pattern matching with
}
} Bart Schaefer wrote on Fri, Sep 09, 2016 at 19:40:33 -0700:
} > ADDITIONAL ASIDE to -workers:  The weird side-effects that result
} > here from having the trailing "/" in the completion results seem
} > to be tangentially related to the thread from 39093 where the whole
} > current word gets erased.  When all the completions end in "/", it
} > is the first unambigous character, so
} > 
} > % foo <TAB>
} > % foo /
} > 
} 
} Could you share the reproducer for this please?

Run this anywhere with more than one subdirectory not all of which have
a common prefix; e.g., the zsh source tree:

torch% compinit -D
torch% _f () { _files -g '*(/M)' }
torch% compdef _f f
torch% zstyle \* file-patterns %p:globbed-files
torch% f <TAB>
torch% f /

If the zstyle is omitted, the groups globbed-files and directories contain
identical sets of matches but are for some reason not de-duped against one
another (probably because none of them matches an actual file name) so you
get a listing instead of the unambiguous-insertion behavior.



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