mirror of
				https://github.com/zsh-users/zsh-syntax-highlighting.git
				synced 2025-10-23 15:46:27 +08:00 
			
		
		
		
	'main': Factor out common logic to after the case/esac.
This commit is contained in:
		
							parent
							
								
									8feb06a022
								
							
						
					
					
						commit
						74c7ffc9b5
					
				| @ -656,7 +656,6 @@ _zsh_highlight_main_highlighter_highlight_list() | |||||||
|       local MATCH; integer MBEGIN MEND |       local MATCH; integer MBEGIN MEND | ||||||
|       local parameter_name |       local parameter_name | ||||||
|       local -a words |       local -a words | ||||||
|       integer elision_is_happening |  | ||||||
|       if [[ $arg[1] == '$' ]] && [[ ${arg[2]} == '{' ]] && [[ ${arg[-1]} == '}' ]]; then |       if [[ $arg[1] == '$' ]] && [[ ${arg[2]} == '{' ]] && [[ ${arg[-1]} == '}' ]]; then | ||||||
|         parameter_name=${${arg:2}%?} |         parameter_name=${${arg:2}%?} | ||||||
|       elif [[ $arg[1] == '$' ]]; then |       elif [[ $arg[1] == '$' ]]; then | ||||||
| @ -670,20 +669,18 @@ _zsh_highlight_main_highlighter_highlight_list() | |||||||
|         case ${(tP)MATCH} in |         case ${(tP)MATCH} in | ||||||
|           (*array*|*assoc*) |           (*array*|*assoc*) | ||||||
|             words=( ${(P)MATCH} ) |             words=( ${(P)MATCH} ) | ||||||
|             elision_is_happening=$(( $#words == 0 )) |  | ||||||
|             ;; |             ;; | ||||||
|           ("") |           ("") | ||||||
|             # not set |             # not set | ||||||
|             words=( ) |             words=( ) | ||||||
|             elision_is_happening=1 |  | ||||||
|             ;; |             ;; | ||||||
|           (*) |           (*) | ||||||
|             # scalar, presumably |             # scalar, presumably | ||||||
|             words=( ${(P)MATCH} ) |             words=( ${(P)MATCH} ) | ||||||
|             elision_is_happening=$(( $#words == 0 )) |  | ||||||
|             ;; |             ;; | ||||||
|         esac |         esac | ||||||
|         if (( elision_is_happening )); then |         if (( $#words == 0 )); then | ||||||
|  |           # Parameter elision is happening | ||||||
|           (( ++in_redirection )) |           (( ++in_redirection )) | ||||||
|           _zsh_highlight_main_add_region_highlight $start_pos $end_pos comment |           _zsh_highlight_main_add_region_highlight $start_pos $end_pos comment | ||||||
|           continue |           continue | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Daniel Shahaf
						Daniel Shahaf