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

Re: Strange bug when completing [ in file names



Bart Schaefer wrote:
> 
> Doesn't that need to be
> 
>                         (#s)(*[^\\]|)[^*?\(\)\<\>\{\}\|]*
> 
> or something similar, so that a word beginning with "[[" can match?
> E.g. a word beginning with the pattern [[:alpha:].]

I did think about that. The documentation says "unless that suffix
itself contains characters eligible for expansion" so I thought I could
ignore trying to worry about an area that isn't the suffix. After
finding an example, I've concluded that it is better with your change.
The following shows the difference:

  touch test/file
  foo=file
  : t*/$foo<tab>
  : */$foo<tab>

The code doesn't only look in the suffix for "other characters eligible
for expansion" anyway. That'd be hard. Is it worth adjusting the
documentation?

There are still inconsistencies in the behaviour but people probably
don't have precise expectations if they ever try such things. Try this:

  bar=test
  : ./$bar/$foo<tab>
  : ~/$bar/$foo<tab>

Oliver



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