brackets: Highlight the closing brackets of arithmetic expansion. (Issue #226.)
This commit is contained in:
		
							parent
							
								
									8b4adbd991
								
							
						
					
					
						commit
						a59f442d2d
					
				|  | @ -278,6 +278,9 @@ _zsh_highlight_main_highlighter() | ||||||
|                           # is how [[ ... ]] is highlighted, too. |                           # is how [[ ... ]] is highlighted, too. | ||||||
|                           style=$ZSH_HIGHLIGHT_STYLES[reserved-word] |                           style=$ZSH_HIGHLIGHT_STYLES[reserved-word] | ||||||
|                           _zsh_highlight_main_add_region_highlight $start_pos $((start_pos + 2)) $style |                           _zsh_highlight_main_add_region_highlight $start_pos $((start_pos + 2)) $style | ||||||
|  |                           if [[ $arg[-2,-1] == '))' ]]; then | ||||||
|  |                             _zsh_highlight_main_add_region_highlight $((end_pos - 2)) $end_pos $style | ||||||
|  |                           fi | ||||||
|                           already_added=1 |                           already_added=1 | ||||||
|                         elif [[ $arg == '()' || $arg == $'\x28' ]]; then |                         elif [[ $arg == '()' || $arg == $'\x28' ]]; then | ||||||
|                           # anonymous function |                           # anonymous function | ||||||
|  |  | ||||||
|  | @ -36,4 +36,5 @@ BUFFER='(( x == 42 ))' | ||||||
| 
 | 
 | ||||||
| expected_region_highlight=( | expected_region_highlight=( | ||||||
|   "1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # (( |   "1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # (( | ||||||
|  |   "12 13 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # )) | ||||||
| ) | ) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue