Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rolandwalker
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant