Highlight quoted command words correctly.

Fixes zsh-users/zsh-syntax-highlighting#147.
This commit is contained in:
Daniel Shahaf
2015-09-28 19:49:39 +00:00
parent 7b4598a764
commit 800158745a
2 changed files with 37 additions and 1 deletions

View File

@@ -157,7 +157,7 @@ _zsh_highlight_main_highlighter()
style=$ZSH_HIGHLIGHT_STYLES[precommand]
sudo=true
else
local res="$(LC_ALL=C builtin type -w $arg 2>/dev/null)"
local res="$(LC_ALL=C builtin type -w ${(Q)arg} 2>/dev/null)"
case $res in
*': reserved') style=$ZSH_HIGHLIGHT_STYLES[reserved-word];;
*': suffix alias')