From e1ecf950e23471b235e318ba7b85e77395a6b146 Mon Sep 17 00:00:00 2001 From: Matthew Martin Date: Mon, 1 Oct 2018 11:10:44 -0400 Subject: [PATCH] main: Do path expanstion after alias expansion --- highlighters/main/main-highlighter.zsh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 663913a..3a8419f 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -503,9 +503,7 @@ _zsh_highlight_main_highlighter_highlight_list() # TODO: this should be done iteratively, e.g., 'alias x=y y=z z=w\n x' # And then the entire 'alias' branch of the 'case' statement should # be done here. - # TODO: path expansion should happen _after_ alias expansion - _zsh_highlight_main_highlighter_expand_path $arg - _zsh_highlight_main__type "$REPLY" + _zsh_highlight_main__type "$arg" local res="$REPLY" if [[ $res == "alias" ]]; then _zsh_highlight_main__resolve_alias $arg @@ -519,6 +517,12 @@ _zsh_highlight_main_highlighter_highlight_list() arg=$reply[1] } fi + _zsh_highlight_main_highlighter_expand_path $arg + arg=$REPLY + if [[ $res != alias ]]; then + _zsh_highlight_main__type "$arg" + res="$REPLY" + fi fi # Analyse the current word.