command word: Protect against the case that the command word starts with a minus.

This commit is contained in:
Daniel Shahaf 2015-10-02 13:27:21 +00:00
parent 07fd773d7e
commit e138cfd765

View File

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