From 018bc45f2159720d530221ff86380ec9e3e3a09f Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 27 Oct 2015 16:22:03 +0200 Subject: [PATCH] Followup to last: tighten the fix and ask a question. --- highlighters/main/main-highlighter.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 5090aef..069c352 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -261,8 +261,12 @@ _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 - if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]] || + if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]]; then + # TODO maybe check *':regular:'* here? + next_word=':start:' + elif [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS:#"$arg"} && $this_word == *':start:' ]]; then + # TODO should this be '=' or '+=' ? $next_word is probably :regular: and nothing looks for that value. next_word+=':start:' fi [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]] && highlight_glob=true