diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index 5079f50..2867dcf 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -278,6 +278,9 @@ _zsh_highlight_main_highlighter() # is how [[ ... ]] is highlighted, too. style=$ZSH_HIGHLIGHT_STYLES[reserved-word] _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 elif [[ $arg == '()' || $arg == $'\x28' ]]; then # anonymous function diff --git a/highlighters/main/test-data/arithmetic-evaluation.zsh b/highlighters/main/test-data/arithmetic-evaluation.zsh index dc26472..9287e91 100644 --- a/highlighters/main/test-data/arithmetic-evaluation.zsh +++ b/highlighters/main/test-data/arithmetic-evaluation.zsh @@ -36,4 +36,5 @@ BUFFER='(( x == 42 ))' expected_region_highlight=( "1 2 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # (( + "12 13 $ZSH_HIGHLIGHT_STYLES[reserved-word]" # )) )