mirror of
				https://github.com/zsh-users/zsh-syntax-highlighting.git
				synced 2025-10-31 01:55:07 +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() | _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. | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Mark Lodato
						Mark Lodato