mirror of
				https://github.com/zsh-users/zsh-syntax-highlighting.git
				synced 2025-10-23 15:46:27 +08:00 
			
		
		
		
	Merge remote-tracking branch 'upstream/pr/179'
* upstream/pr/179: Don't parse first word of array assignment as command
This commit is contained in:
		
						commit
						51aed8a765
					
				| @ -160,7 +160,11 @@ _zsh_highlight_main_highlighter() | ||||
|         *': hashed')    style=$ZSH_HIGHLIGHT_STYLES[hashed-command];; | ||||
|         *)              if _zsh_highlight_main_highlighter_check_assign; then | ||||
|                           style=$ZSH_HIGHLIGHT_STYLES[assign] | ||||
|                           new_expression=true | ||||
|                           if [[ $arg[-1] != '(' ]]; then | ||||
|                             # assignment to a scalar parameter. | ||||
|                             # (For array assignments, the command doesn't start until the ")" token.) | ||||
|                             new_expression=true | ||||
|                           fi | ||||
|                         elif _zsh_highlight_main_highlighter_check_path; then | ||||
|                           style=$ZSH_HIGHLIGHT_STYLES[path] | ||||
|                         elif [[ $arg[0,1] == $histchars[0,1] || $arg[0,1] == $histchars[2,2] ]]; then | ||||
|  | ||||
| @ -28,8 +28,9 @@ | ||||
| # vim: ft=zsh sw=2 ts=2 et | ||||
| # ------------------------------------------------------------------------------------------------- | ||||
| 
 | ||||
| BUFFER='A=1' | ||||
| BUFFER='A=1 b=("foo" bar)' | ||||
| 
 | ||||
| expected_region_highlight=( | ||||
|   "1 3 $ZSH_HIGHLIGHT_STYLES[assign]" # A=1 | ||||
|   "8 12 $ZSH_HIGHLIGHT_STYLES[double-quoted-argument]" # "foo" | ||||
| ) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Daniel Shahaf
						Daniel Shahaf