'main': Fix the last commit's bug concerning parameter elision not happening in redirects in command position.

This commit is contained in:
Daniel Shahaf 2020-05-13 12:51:52 +00:00
parent 41b8a74692
commit ea3ae74164
2 changed files with 4 additions and 4 deletions

View file

@ -750,7 +750,7 @@ _zsh_highlight_main_highlighter_highlight_list()
# parameters that refer to commands, functions, and builtins.
() {
local -a words; words=( "${reply[@]}" )
if (( $#words == 0 )); then
if (( $#words == 0 )) && (( ! in_redirection )); then
# Parameter elision is happening
(( ++in_redirection ))
_zsh_highlight_main_add_region_highlight $start_pos $end_pos comment

View file

@ -32,7 +32,7 @@ BUFFER=$'<$foo cat cat'
expected_region_highlight=(
'1 1 redirection' # <
'2 5 default "fixed in the next commit"' # $foo
'7 9 command "fixed in the next commit"' # cat
'11 13 default "fixed in the next commit"' # cat
'2 5 default' # $foo
'7 9 command' # cat
'11 13 default' # cat
)