Skip to content

Commit

Permalink
'main': Fix issue sorin-ionescu#290, «Mishighlights "longloops" 'repe…
Browse files Browse the repository at this point in the history
…at'».
  • Loading branch information
danielshahaf committed May 13, 2016
1 parent 4832f18 commit ef68f50
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion highlighters/main/main-highlighter.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,11 @@ _zsh_highlight_main_highlighter()
# The redirection mechanism assumes $this_word describes the word
# following the redirection. Make it so.
#
# That word can be a command word with shortloops (`repeat 2 ls`)
# or a command separator (`repeat 2; ls` or `repeat 2; do ls; done`).
#
# The repeat-count word will be handled like a redirection target.
this_word=':start:'
this_word=':start::regular:'
fi
start_pos=$end_pos
(( in_redirection == 0 )) && this_word=$next_word
Expand Down
2 changes: 1 addition & 1 deletion highlighters/main/test-data/control-flow2.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ BUFFER='repeat 42; do ls; done'
expected_region_highlight+=(
"1 6 reserved-word" # repeat
"8 9 default" # 42
"10 10 commandseparator 'issue #290'" # ;
"10 10 commandseparator" # ;
"12 13 reserved-word" # do
"15 16 command" # ls
"17 17 commandseparator" # ;
Expand Down

0 comments on commit ef68f50

Please sign in to comment.