mirror of
https://github.com/zsh-users/zsh-syntax-highlighting
synced 2024-12-19 01:44:37 +00:00
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:
parent
dbd27cb30a
commit
c62cb54e9d
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user