diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 59d4036..6053337 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -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 diff --git a/highlighters/main/test-data/redirection-inhibits-elision.zsh b/highlighters/main/test-data/redirection-inhibits-elision.zsh index be5e431..c0ca267 100644 --- a/highlighters/main/test-data/redirection-inhibits-elision.zsh +++ b/highlighters/main/test-data/redirection-inhibits-elision.zsh @@ -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 )