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

Re: Completion on =



Zefram wrote:

> The patch below fixes a couple of problems with filename completion on
> ~ and =.  Previously these characters were treated specially for
> completion even if quoted.

I did not test your changes yet, but I'm almost sure that they are not
correct.  Look at the first occurrance of docompletion() in zle_tricky.c.  The
current word is untokenized just before this call except those thing which are
within ${...} parameter expansion.  For some reason I do not remember clearly,
this is necessary (I think filename completion doesn't work well without it).
I'm sure that Sven could explain the problem more clearly.  The most confusing
thing is that docompletion() sometimes called with the tokenized string.  If
you examine makecomplist() (used to be docompletion()) more carefuly, you'll
see, that tokens and simple characters are handled similarily. E.g.

            if (*b != '^' && *b != Hat &&
                *b != '=' && *b != Equals &&
                *b != '~' && *b != Tilde)

I'm working now to fix several problems related to quoted characters in
completion strings.  I fixed most of the bugs here, and I think this bug can
also be fixed. A quoted tilde or = is always preceeded by a backslash, so in
this case line[wb] == '\\'.  We can use that to decide wether the tilde or =
is quoted or not.  But I guess it may be problematic when completing things
like \~foo$bar<TAB> since in this case (if I remember right) wb points after
the $.

Bye,
  Zoltan



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