'main': Fix an issue whereby a --option was highlighted as a file

Regression test included.

Fixes #578.

Review-by: Matthew Martin
This commit is contained in:
Daniel Shahaf
2019-06-16 20:21:58 +00:00
parent 650dd79d86
commit fd4c5db4c9
2 changed files with 42 additions and 2 deletions

View File

@@ -1045,9 +1045,10 @@ _zsh_highlight_main_highlighter_highlight_argument()
highlights+=($reply)
;;
'$')
path_eligible=0
if [[ $arg[i+1] != "'" ]]; then
path_eligible=0
fi
if [[ $arg[i+1] == "'" ]]; then
path_eligible=1
_zsh_highlight_main_highlighter_highlight_dollar_quote $i
(( i = REPLY ))
highlights+=($reply)