'main': Don't find command positions within multiline array literals.

Fixes #333.
This commit is contained in:
Daniel Shahaf
2016-09-24 17:55:18 +00:00
parent 5627fd2045
commit 8bf423d16d
2 changed files with 47 additions and 2 deletions

View File

@@ -613,8 +613,13 @@ _zsh_highlight_highlighter_main_paint()
[[ $style == path || $style == path_prefix ]] && _zsh_highlight_main_highlighter_highlight_path_separators
fi
if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]]; then
next_word=':start:'
highlight_glob=true
if [[ $arg == ';' ]] && $in_array_assignment; then
# literal newline inside an array assignment
next_word=':regular:'
else
next_word=':start:'
highlight_glob=true
fi
elif
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_CONTROL_FLOW:#"$arg"} && $this_word == *':start:'* ]] ||
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS:#"$arg"} && $this_word == *':start:'* ]]; then