[diffs/editor] Add match brackets#940
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e393e7626f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| --diffs-editor-bracket-match-bg: ${bracketMatchBackground ?? 'unset'}; | ||
| --diffs-editor-bracket-match-border: ${bracketMatchBorder ?? 'unset'}; |
There was a problem hiding this comment.
Preserve fallback bracket-match styling
With themes that don't define editorBracketMatch.background or editorBracketMatch.border (the bundled Pierre themes don't), these assignments still define the CSS variables as unset, so the fallback colors in editor.css are never used; background-color becomes transparent and the border-bottom shorthand is invalid after substitution. As a result bracket matches can render with no visible highlight by default, so leave these variables undefined or assign the fallback values when the theme key is absent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
use initial instead of unset in dfadcf9
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfadcf9dfc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| text ??= textDocument.getText(); | ||
| ignoredOffsets ??= getBracketIgnoredOffsets(text); |
There was a problem hiding this comment.
Avoid rescanning the whole document for each bracket move
With bracket matching enabled by default, every selection update where the caret is adjacent to a bracket calls getText() and rebuilds ignoredOffsets for the entire TextDocument before searching. In large editable diffs/files, simply arrowing over a bracket allocates and scans O(file size) on the UI path even when the match is nearby, which can freeze the editor; cache this per document version or limit the scan/token data to the needed range.
Useful? React with 👍 / 👎.
5fc7865 to
dfadcf9
Compare
Add match brackets, can be disabled by adding
matchBracketsin the editor options.Screen.Recording.2026-07-03.at.23.09.32.mov