Fix issue #205, "';' after assignment is highlighted as unknown-token".
This commit is contained in:
parent
6d6fb8b03e
commit
01d7eeb3c7
|
@ -212,6 +212,9 @@ _zsh_highlight_main_highlighter()
|
||||||
fi
|
fi
|
||||||
elif [[ $arg[0,1] == $histchars[0,1] || $arg[0,1] == $histchars[2,2] ]]; then
|
elif [[ $arg[0,1] == $histchars[0,1] || $arg[0,1] == $histchars[2,2] ]]; then
|
||||||
style=$ZSH_HIGHLIGHT_STYLES[history-expansion]
|
style=$ZSH_HIGHLIGHT_STYLES[history-expansion]
|
||||||
|
elif [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]] &&
|
||||||
|
[[ $this_word == *':regular:'* ]]; then
|
||||||
|
style=$ZSH_HIGHLIGHT_STYLES[commandseparator]
|
||||||
elif [[ $arg[1] == '<' || $arg[1] == '>' ]]; then
|
elif [[ $arg[1] == '<' || $arg[1] == '>' ]]; then
|
||||||
style=$ZSH_HIGHLIGHT_STYLES[redirection]
|
style=$ZSH_HIGHLIGHT_STYLES[redirection]
|
||||||
(( in_redirection=2 ))
|
(( in_redirection=2 ))
|
||||||
|
@ -282,8 +285,7 @@ _zsh_highlight_main_highlighter()
|
||||||
next_word=':start:'
|
next_word=':start:'
|
||||||
elif
|
elif
|
||||||
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS:#"$arg"} && $this_word == *':start:' ]]; then
|
[[ -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:'
|
||||||
next_word+=':start:'
|
|
||||||
fi
|
fi
|
||||||
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]] && highlight_glob=true
|
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]] && highlight_glob=true
|
||||||
start_pos=$end_pos
|
start_pos=$end_pos
|
||||||
|
|
|
@ -31,6 +31,6 @@ ZSH_HIGHLIGHT_STYLES[commandseparator]=$unused_highlight
|
||||||
BUFFER='A=1; echo hello world'
|
BUFFER='A=1; echo hello world'
|
||||||
|
|
||||||
expected_region_highlight=(
|
expected_region_highlight=(
|
||||||
"4 4 $ZSH_HIGHLIGHT_STYLES[commandseparator] 'issue #205'" # ;
|
"4 4 $ZSH_HIGHLIGHT_STYLES[commandseparator]" # ;
|
||||||
"6 9 $ZSH_HIGHLIGHT_STYLES[command]" # echo
|
"6 9 $ZSH_HIGHLIGHT_STYLES[command]" # echo
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user