Fix syntax error with zsh-5.0.5-dev-1 and older.

zsh prior to workers/32609 (commit 9d47e8398d299e53ffe4e7ddf3731d2fedae9948)
does not support the (-n)-less «[[ $var ]]» syntax.

Fixes zsh-users/zsh-syntax-highlighting#225.
This commit is contained in:
Daniel Shahaf 2015-10-30 09:34:16 +02:00
parent afa6bb3882
commit 8ab8c815ec

View file

@ -194,7 +194,7 @@ _zsh_highlight_main_highlighter()
((end_pos=$start_pos+${#arg})) ((end_pos=$start_pos+${#arg}))
fi fi
if [[ ${interactive_comments+'set'} && $arg[1] == $histchars[3] ]]; then if [[ -n ${interactive_comments+'set'} && $arg[1] == $histchars[3] ]]; then
if [[ $this_word == *(':regular:'|':start:')* ]]; then if [[ $this_word == *(':regular:'|':start:')* ]]; then
style=$ZSH_HIGHLIGHT_STYLES[comment] style=$ZSH_HIGHLIGHT_STYLES[comment]
else else