zsh-syntax-highlighting icon indicating copy to clipboard operation
zsh-syntax-highlighting copied to clipboard

Add bracket-error-open and bracket-error-close bracket highlighting styles

Open rolandwalker opened this issue 4 years ago • 0 comments

Rationale:

Typing at the command-line generally proceeds from left to right, and the typist may open many brackets as he goes. Newly-opened brackets usually not errors, but unfinished thoughts. The user may therefore wish to style open-bracket match-failures differently than close-bracket match-failures.

I prefer to color only the close-bracket match-failure as an error:

ZSH_HIGHLIGHT_STYLES[bracket-error-open]=default
ZSH_HIGHLIGHT_STYLES[bracket-error-close]='fg=red'

This code actually could be written to fall through to bracket-error instead of having a distinct bracket-error-close style, but that asymmetry might confuse the user.

rolandwalker avatar Nov 11 '20 22:11 rolandwalker