Open danielshahaf opened 8 years ago
The expansion order is now: alias, tilde, parameter; however one should note that
foo='~root'
echo $foo
does not expand to /root
, so we should keep track of quoting if the order is fixed.
I think nowadays we could implement that easily by having _zsh_highlight_main_highlighter_expand_path
check (( in_param ))
. Test case: set a=/usr
then type $a
in command position (without a trailing space).
https://github.com/zsh-users/zsh-syntax-highlighting/blob/5e4b446dee770a811ffb6c19ee41f624895e56da/highlighters/main/main-highlighter.zsh#L275-L300
As zshexpn(1) specifies, alias expansion precedes parameter expansion which precedes tilde expansion. However, the code implements them in a different order (e.g., tilde expansion is performed before alias expansion).