Fix issue #209, "precommand modifiers at non-command-word position".

This commit is contained in:
Daniel Shahaf
2015-10-27 13:35:04 +02:00
parent 88cf98d9c4
commit 2c9f8c8c95
2 changed files with 5 additions and 2 deletions

View File

@@ -261,7 +261,10 @@ _zsh_highlight_main_highlighter()
# if a style_override was set (eg in _zsh_highlight_main_highlighter_check_path), use it
[[ -n $style_override ]] && style=$ZSH_HIGHLIGHT_STYLES[$style_override]
(( already_added )) || _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_FOLLOWED_BY_COMMANDS:#"$arg"} ]] && next_word+=':start:'
if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]] ||
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS:#"$arg"} && $this_word == *':start:' ]]; then
next_word+=':start:'
fi
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]] && highlight_glob=true
start_pos=$end_pos
this_word=$next_word