Skip to content

Add completeBrackets flag to Behavior configuration#366

Open
cavoco wants to merge 1 commit intoCodeEditApp:mainfrom
cavoco:fix/bracket-completion-toggle
Open

Add completeBrackets flag to Behavior configuration#366
cavoco wants to merge 1 commit intoCodeEditApp:mainfrom
cavoco:fix/bracket-completion-toggle

Conversation

@cavoco
Copy link

@cavoco cavoco commented Feb 27, 2026

Summary

  • Adds a completeBrackets: Bool property to SourceEditorConfiguration.Behavior (defaults to true)
  • When false, setUpTextFormation() skips registering StandardOpenPairFilter and DeleteCloseFilter, disabling automatic bracket completion
  • Changing the value at runtime triggers setUpTextFormation() to rebuild the filter list
  • Adds two unit tests verifying the filter list contents for both enabled and disabled states

Context

This is needed to fix CodeEdit#1691 — the "Autocomplete Braces" setting in CodeEdit's text editing preferences exists in the UI but has no effect because there was no way to pass it through to the source editor configuration.

Once this is merged, the CodeEdit side just needs to wire autocompleteBraces into the behavior config in CodeFileView.swift.

Test plan

  • test_completeBracketsEnabled — verifies pair filters are present when enabled
  • test_completeBracketsDisabled — verifies pair filters are absent when disabled
  • All existing TextViewControllerTests pass with no regressions

Add a completeBrackets property to SourceEditorConfiguration.Behavior
that controls whether bracket pair completion filters are registered.
When false, open-pair and delete-pair filters are skipped in
setUpTextFormation(), allowing consumers to disable automatic bracket
completion via configuration.

Fixes CodeEditApp/CodeEdit#1691
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.

🐞 Autocomplete Braces setting is completely non-functional

1 participant