Skip to content

Commit ea3ae74

Browse files
committed
'main': Fix the last commit's bug concerning parameter elision not happening in redirects in command position.
1 parent 41b8a74 commit ea3ae74

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

highlighters/main/main-highlighter.zsh

+1-1
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ _zsh_highlight_main_highlighter_highlight_list()
750750
# parameters that refer to commands, functions, and builtins.
751751
() {
752752
local -a words; words=( "${reply[@]}" )
753-
if (( $#words == 0 )); then
753+
if (( $#words == 0 )) && (( ! in_redirection )); then
754754
# Parameter elision is happening
755755
(( ++in_redirection ))
756756
_zsh_highlight_main_add_region_highlight $start_pos $end_pos comment

highlighters/main/test-data/redirection-inhibits-elision.zsh

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ BUFFER=$'<$foo cat cat'
3232

3333
expected_region_highlight=(
3434
'1 1 redirection' # <
35-
'2 5 default "fixed in the next commit"' # $foo
36-
'7 9 command "fixed in the next commit"' # cat
37-
'11 13 default "fixed in the next commit"' # cat
35+
'2 5 default' # $foo
36+
'7 9 command' # cat
37+
'11 13 default' # cat
3838
)

0 commit comments

Comments
 (0)