Bracket pair colorization: op-in-flag to only colorize on focus
See original GitHub issueThere should be a flag where any brackets remain at their original colour (let’s say a 33% white on black), unless the bracket is in focus.
Reasoning: Brackets can be noise in code that make it hard to see what is going on, but at other times understanding which brackets pair up is crucial.
Bracket pair colorization should because of this have an opt-in feature where, once bracket pair colorization is enabled, given that new flag is toggled on, only render for the current context.
A context here means a logical block of code wrapped by brackets.
{foo} // 2 contexts, `:root` and within `:root > {`
{(true)} // 3 contexts, `:root`, `:root > {` and `:root > { > (`
"editor.bracketPairColorization.enableOnlyOnFocusOf": "brackets"
^ Colorizes brackets of this context and any children of that context if the cursor is before or after a given bracket:
"editor.bracketPairColorization.enableOnlyOnFocusOf": "context"
^ Colorizes brackets of this context and any children of that context if the cursor is within a given context:
Essentially for both flags any code outside of a context in focus (cursor) would not colorize. The code inside would colorize based on if there is a focus (cursor) on/around a backet or, for the 2nd flag value, context.
"editor.bracketPairColorization.enableOnlyOnFocusOfTriggeredByHover": true
^ Would enable pair colouring while hovering with the mouse so you don’t need to click to see how things pair up.
Issue Analytics
- State:
- Created a year ago
- Reactions:56
- Comments:8 (1 by maintainers)
Top GitHub Comments
yes, that would be the case.
It is similar but this suggestion here includes more options like coloring on hover if opted into instead of just the cursor. And colouring if on brackets or just in a context (colour direct parent brackets and any children brackets)