'main': Support multiple styles in _zsh_highlight_main_add_region_highlight
This commit is contained in:
		
							parent
							
								
									d37c55c788
								
							
						
					
					
						commit
						61f43255ab
					
				|  | @ -68,7 +68,7 @@ _zsh_highlight_main_highlighter_predicate() | ||||||
| # Helper to deal with tokens crossing line boundaries. | # Helper to deal with tokens crossing line boundaries. | ||||||
| _zsh_highlight_main_add_region_highlight() { | _zsh_highlight_main_add_region_highlight() { | ||||||
|   integer start=$1 end=$2 |   integer start=$1 end=$2 | ||||||
|   local style=$3 |   shift 2 | ||||||
| 
 | 
 | ||||||
|   # The calculation was relative to $PREBUFFER$BUFFER, but region_highlight is |   # The calculation was relative to $PREBUFFER$BUFFER, but region_highlight is | ||||||
|   # relative to $BUFFER. |   # relative to $BUFFER. | ||||||
|  | @ -77,7 +77,7 @@ _zsh_highlight_main_add_region_highlight() { | ||||||
| 
 | 
 | ||||||
|   (( end < 0 )) && return # having end<0 would be a bug |   (( end < 0 )) && return # having end<0 would be a bug | ||||||
|   (( start < 0 )) && start=0 # having start<0 is normal with e.g. multiline strings |   (( start < 0 )) && start=0 # having start<0 is normal with e.g. multiline strings | ||||||
|   _zsh_highlight_add_highlight $start $end $style |   _zsh_highlight_add_highlight $start $end "$@" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| # Wrapper around 'type -w'. | # Wrapper around 'type -w'. | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue