brackets: Highlight the closing brackets of arithmetic expansion. (Issue #226.)

This commit is contained in:
Daniel Shahaf 2015-10-30 17:28:48 +00:00
parent 8b4adbd991
commit a59f442d2d
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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]" # ))
) )