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

Re: _files with match-specs



Eric Cook wrote on Tue, May 05, 2015 at 23:48:38 -0400:
> Hey,
> Not sure if i am doing something incorrect here but:
> 
> % _foo() _files -M 'L:|+='; compdef _foo foo
> 
> then
> % foo +<tab>
> Complete files, but removes the leading +.
> 
> When i give the same match-spec to compadd directly, it works as i expected.
> 
> % _foo() compadd -M 'L:|+=' -- *(N); compdef _foo foo
> 
> then
> % foo +<tab>
> 
> Is the behavior of _files expected?

Don't know.

> If so, how should I go about completing filenames, ignoring a possible
> leading + character?

'_f() { compset -P +; _files }', perhaps?

Daniel



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