do not remove quotes when checking assignments

Zsh does not allow the variable name or the equals sign to be quoted or
escaped.  The previous code incorrectly highlighted the following
examples as assignments:

    $ 'x=y'
    zsh: command not found: x=y
    $ x\=y
    zsh: command not found: x=y
    $ "x"=y
    zsh: command not found: x=y
    $ \x=y
    zsh: command not found: x=y
This commit is contained in:
Mark Lodato 2013-10-30 00:00:16 -04:00
parent dbd27cb30a
commit c62cb54e9d

View File

@ -153,7 +153,7 @@ _zsh_highlight_main_highlighter()
_zsh_highlight_main_highlighter_check_assign() _zsh_highlight_main_highlighter_check_assign()
{ {
setopt localoptions extended_glob setopt localoptions extended_glob
[[ ${(Q)arg} == [[:alpha:]_]([[:alnum:]_])#=* ]] [[ $arg == [[:alpha:]_]([[:alnum:]_])#=* ]]
} }
# Check if the argument is a path. # Check if the argument is a path.