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, Mar 31, 2022 at 3:36 PM Lawrence Velázquez <larryv@xxxxxxx> wrote:
>
> On Sun, Aug 1, 2021, at 2:50 PM, Marlon Richert wrote:
> > Alright, here's a new patch, which moves the alias expansion code from
> > _expand_alias to _expand (and refactors it) and deprecates
> > _expand_alias's use as a completer. I also updated the documentation
> > and added tests.
>
> *bump*

I'm uncomfortable with the change that expanding aliases in command
position is the default behavior of _expand.  It never did this
before.  It means that if there is an alias that is the prefix of
another command name, expanding that alias will take precedence over
completing the suffix, which i think is an undesirable effect as a new
default.

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;
the first TAB should stop before the space is appended so a second TAB
can do the expanding.  Perhaps there's a combination of the supported
styles that provides this behavior, I didn't dig into it very far.




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