Skip to content

autoClosePairsEnabled = false does not disable [[…]] autocomplete #114

Description

@robin-liquidium

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
  1. Create a NativeTextViewWrapper with that configuration.
  2. Type [ once: the editor correctly contains [.
  3. 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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions