Summary
Setting configuration.lists.autoClosePairsEnabled = false disables the documented single-pair completion for [], but typing a second consecutive [ still inserts closing brackets and produces [[]].
Reproduction
var configuration = MarkdownEditorConfiguration.default
configuration.lists.autoClosePairsEnabled = false
- Create a
NativeTextViewWrapper with that configuration.
- Type
[ once: the editor correctly contains [.
- Type
[ again: the editor changes the text to [[]] and places the caret inside.
Expected
With autoClosePairsEnabled disabled, typing [[ should leave the literal text [[ and should not insert ]].
Cause observed in 0.11.0
MarkdownListHandler.handleInsertion handles the prevChar == "[" wiki-link branch before the guard autoClosePairsEnabled check. The first bracket therefore respects the setting, while the second bracket bypasses it.
The configuration documentation describes this property as the master switch for auto-closing (), {}, and [], so the wiki-link branch appears to violate the setting.
Version
- swift-markdown-engine 0.11.0
- revision
9244f8bc88590520a902b83b9f6c3f45d0690eb7
- macOS / AppKit
NativeTextViewWrapper
This was reproduced in an embedding app with the default no-op wiki-link service.
Summary
Setting
configuration.lists.autoClosePairsEnabled = falsedisables the documented single-pair completion for[], but typing a second consecutive[still inserts closing brackets and produces[[]].Reproduction
NativeTextViewWrapperwith that configuration.[once: the editor correctly contains[.[again: the editor changes the text to[[]]and places the caret inside.Expected
With
autoClosePairsEnableddisabled, typing[[should leave the literal text[[and should not insert]].Cause observed in 0.11.0
MarkdownListHandler.handleInsertionhandles theprevChar == "["wiki-link branch before theguard autoClosePairsEnabledcheck. The first bracket therefore respects the setting, while the second bracket bypasses it.The configuration documentation describes this property as the master switch for auto-closing
(),{}, and[], so the wiki-link branch appears to violate the setting.Version
9244f8bc88590520a902b83b9f6c3f45d0690eb7NativeTextViewWrapperThis was reproduced in an embedding app with the default no-op wiki-link service.