main: Expand aliases before looking for redirections

This commit is contained in:
Matthew Martin 2018-03-25 21:41:03 -05:00
parent e43e4fd2c7
commit 05a55108c9

View File

@ -498,16 +498,6 @@ _zsh_highlight_main_highlighter_highlight_list()
continue
fi
# Analyse the current word.
if _zsh_highlight_main__is_redirection $arg ; then
if (( in_redirection )); then
_zsh_highlight_main_add_region_highlight $start_pos $end_pos unknown-token
already_added=1
else
in_redirection=2
fi
fi
# Expand aliases.
# 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
@ -529,6 +519,16 @@ _zsh_highlight_main_highlighter_highlight_list()
}
fi
# Analyse the current word.
if _zsh_highlight_main__is_redirection $arg ; then
if (( in_redirection )); then
_zsh_highlight_main_add_region_highlight $start_pos $end_pos unknown-token
already_added=1
else
in_redirection=2
fi
fi
# Expand parameters.
#
# ### For now, expand just '$foo' or '${foo}', possibly with braces, but with