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

Re: [PATCH] Make _expand handle aliases (was Re: [PATCH] Make _expand_alias more usable as a completer)



On Thu, May 5, 2022 at 10:58 PM Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
On Fri, Apr 1, 2022 at 3:37 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Furthermore, the behavior is a bit odd.  With the patch, given an
> alias named "xyz", and completer style _expand _complete, if you type
> TAB after "xy" you get "xyz " (with trailing space).  Since TAB after
> "xyz" yields the the value of the alias, the added space feels wrong;

I don't like the way the space is added either, but it worked like
that before, too.

But before it was arguably correct, because you're completing a command, not performing an expansion; theoretically there's nothing left to do to the word after it completes.
 
I suppose it's better to be offered as part of
completing aliases, but listed separately, after the actual alias
completions.

This is tricky, because if you complete (rather than expand) to a value that has multiple shell words, you can't enter normal menu completion -- the next TAB will find that the line has new words on it and start a new completion in that context.  Which might be the behavior you want here, but would definitely need to be a style setting.


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