Code style
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
This commit is contained in:
		
							parent
							
								
									6879d3c29f
								
							
						
					
					
						commit
						dd84bff854
					
				|  | @ -51,8 +51,7 @@ _zsh_highlight-keyword() { | ||||||
| 
 | 
 | ||||||
| _zsh_highlight-keyword-loop() { | _zsh_highlight-keyword-loop() { | ||||||
|   # This does *not* do its job syntactically, sorry. |   # This does *not* do its job syntactically, sorry. | ||||||
|   local buf="$1" |   local buf="$1" pat="$2" | ||||||
|   local pat="$2" |  | ||||||
|   local -a match mbegin mend |   local -a match mbegin mend | ||||||
|   if [[ "$buf" == (#b)(*)(${~pat})* ]]; then |   if [[ "$buf" == (#b)(*)(${~pat})* ]]; then | ||||||
|     region_highlight+=("$((mbegin[2] - 1)) $mend[2] $ZSH_HIGHLIGHT_KEYWORD_KEYWORDS[$pat]") |     region_highlight+=("$((mbegin[2] - 1)) $mend[2] $ZSH_HIGHLIGHT_KEYWORD_KEYWORDS[$pat]") | ||||||
|  |  | ||||||
|  | @ -157,8 +157,7 @@ _zsh_highlight-zle-buffer() { | ||||||
| 
 | 
 | ||||||
| # Whether supplied highlight_predicate satisfies or not. | # Whether supplied highlight_predicate satisfies or not. | ||||||
| _zsh_highlight-zle-buffer-p() { | _zsh_highlight-zle-buffer-p() { | ||||||
|   local region_highlight_size="$1" |   local region_highlight_size="$1" highlight_predicate="$2" | ||||||
|   local highlight_predicate="$2" |  | ||||||
|   # If any highlightings are not taken into account, asume it is needed. |   # If any highlightings are not taken into account, asume it is needed. | ||||||
|   # This holds for some up/down-history commands, for example. |   # This holds for some up/down-history commands, for example. | ||||||
|   ((region_highlight_size == 0)) || "$highlight_predicate" |   ((region_highlight_size == 0)) || "$highlight_predicate" | ||||||
|  | @ -176,9 +175,7 @@ _zsh_cursor-moved-p() { | ||||||
| 
 | 
 | ||||||
| # Register a highlighting function. | # Register a highlighting function. | ||||||
| _zsh_add-highlighter() { | _zsh_add-highlighter() { | ||||||
|   local func="$1" |   local func="$1" pred="${2-${1}-p}" cache_place="${3-${1//-/_}}" | ||||||
|   local pred="${2-${1}-p}" |  | ||||||
|   local cache_place="${3-${1//-/_}}" |  | ||||||
|   zsh_highlight_functions+=$func |   zsh_highlight_functions+=$func | ||||||
|   zsh_highlight_predicates+=$pred |   zsh_highlight_predicates+=$pred | ||||||
|   zsh_highlight_caches+=$cache_place |   zsh_highlight_caches+=$cache_place | ||||||
|  | @ -191,10 +188,7 @@ _zsh_add-highlighter _zsh_highlight-bracket-match | ||||||
| # Core syntax highlighting. | # Core syntax highlighting. | ||||||
| _zsh_main-highlight() { | _zsh_main-highlight() { | ||||||
|   setopt localoptions extendedglob bareglobqual |   setopt localoptions extendedglob bareglobqual | ||||||
|   local new_expression=true |   local start_pos=0 end_pos highlight_glob=true new_expression=true arg style | ||||||
|   local start_pos=0 |  | ||||||
|   local highlight_glob=true |  | ||||||
|   local end_pos arg style |  | ||||||
|   region_highlight=() |   region_highlight=() | ||||||
|   for arg in ${(z)BUFFER}; do |   for arg in ${(z)BUFFER}; do | ||||||
|     local substr_color=0 |     local substr_color=0 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue