From c62cb54e9db82a64aa0975f84c2ab46a056e965e Mon Sep 17 00:00:00 2001 From: Mark Lodato Date: Wed, 30 Oct 2013 00:00:16 -0400 Subject: [PATCH] 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 --- highlighters/main/main-highlighter.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index f70a286..e2abcc1 100755 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -153,7 +153,7 @@ _zsh_highlight_main_highlighter() _zsh_highlight_main_highlighter_check_assign() { setopt localoptions extended_glob - [[ ${(Q)arg} == [[:alpha:]_]([[:alnum:]_])#=* ]] + [[ $arg == [[:alpha:]_]([[:alnum:]_])#=* ]] } # Check if the argument is a path.