Skip to content

fix: Add missing listener for autoCloseBrackets setting - #2471

Closed
claycuy wants to merge 3 commits into
Acode-Foundation:mainfrom
claycuy:fix/bracket
Closed

claycuy wants to merge 3 commits into
Acode-Foundation:mainfrom
claycuy:fix/bracket

Conversation

@claycuy

@claycuy claycuy commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes several editor display options update dynamically. The main changes are:

  • Added CodeMirror imports for bracket and highlight extensions.
  • Added compartments for bracket and highlight settings.
  • Added update listeners for bracket matching, auto-close brackets, active-line highlighting, and selection-match highlighting.

Confidence Score: 4/5

This should be fixed before merging.

  • Some editor options can still leave old behavior active after a setting change.
  • Active-line highlighting has two owners, and only one is refreshed by the new listener.

src/lib/editorManager.js

Important Files Changed

Filename Overview
src/lib/editorManager.js Adds dynamic CodeMirror settings wiring for bracket and highlight behavior.

Reviews (2): Last reviewed commit: "feat: Added bracket and highlight Compar..." | Re-trigger Greptile

Comment thread src/lib/editorManager.js
@claycuy

claycuy commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@greptile

Comment thread src/lib/editorManager.js
},
{
keys: ["autoCloseBrackets", "bracketMatching"],
compartments: [bracketCompartment],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Unmanaged extensions remain

This dynamic option now owns the compartmented bracket extensions, but editor states still get the same bracket and highlight extensions from the static base extension path. When a user turns autoCloseBrackets, bracketMatching, highlightActiveLine, or highlightSelectionMatches off, applyOptions() can remove only the compartmented copy. The unmanaged copy remains active in the editor state, so the setting can still appear changed while the editor keeps the old bracket or highlight behavior. These extensions need a single owner so runtime setting changes can fully remove them.

Comment thread src/lib/editorManager.js
},
{
keys: ["highlightActiveLine", "highlightSelectionMatches"],
compartments: [highlightCompartment],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Gutter highlight stays stale

This spec updates the main highlightActiveLine() extension, but the active-line gutter marker is configured through the line-number extension path. When highlightActiveLine is turned off, this listener only reconfigures highlightCompartment, so the gutter extension can keep using the old value and continue highlighting the active line in the gutter. The setting update needs to refresh both owners of active-line highlighting.

@bajrangCoder

Copy link
Copy Markdown
Member

This is different thing, not the fix for linked issue.

@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Jul 10, 2026
@claycuy

claycuy commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Okay, no problem! It seems I did go off track while creating this PR. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants