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

Re: file completion of ~user/... stats wrong directory



>>>>> Peter Stephenson <pws@xxxxxxx> writes:

> prepaths comes from the -W option (see the zparseopts call), which is used
> when you want the file matcher to behave as if there was a path
> prefix---for example, to complete folders in your mail directory, you might
> use "-W ~/Mail".

Right, I'd kinda surmised it was something like that.

> I think the reason it's not an empty array is that matches are eventually
> generated in a loop over all -W paths.  If there are none, we still want to
> execute that loop once, but with an empty prepath (at line 340):

> for prepath in "$prepaths[@]"; do

So do you agree it's a bug that it's stat-ing the path with the ~user/
stripped off, effectively then relative to the current directory?

So, if it needs to go through that loop at least once, then maybe when
'prepath' (singular) is '' it should be prepending any stuff that got
stripped off the front back on?  Guess I'll have to grovel through
there and try to make sense of what's going on...

Greg



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