Skip to content

Search keymap: ctrl+d produces multiple selections even when allowMultipleSelections is false #1288

@personalizedrefrigerator

Description

Describe the issue

With the search keymap enabled, selecting text that appears multiple times then pressing ctrl+d selects all occurrences of that text, even when EditorState.allowMultipleSelections.of(false) is provided as an extension.

Steps to reproduce:

  1. Open the linked example
  2. Select test
  3. Press ctrl+d
  4. Type replaced
  5. Comment out drawSelection()
  6. Re-run
  7. Repeat steps 1-4

After step 4 (both times), both occurrences of test are replaced with replaced.

Browser and platform

Firefox 119.0, Ubuntu 23.10

Reproduction link

https://codemirror.net/try/?c=aW1wb3J0IHtFZGl0b3JTdGF0ZX0gZnJvbSAiQGNvZGVtaXJyb3Ivc3RhdGUiCmltcG9ydCB7ZHJhd1NlbGVjdGlvbiwgRWRpdG9yVmlldywga2V5bWFwLCBoaWdobGlnaHRTcGVjaWFsQ2hhcnN9IGZyb20gIkBjb2RlbWlycm9yL3ZpZXciCmltcG9ydCB7IHNlYXJjaCwgc2VhcmNoS2V5bWFwLCBoaWdobGlnaHRTZWxlY3Rpb25NYXRjaGVzIH0gZnJvbSAnQGNvZGVtaXJyb3Ivc2VhcmNoJwoKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6ICJ0ZXN0IHRlc3QiLAogIGV4dGVuc2lvbnM6IFsKICAgIGRyYXdTZWxlY3Rpb24oKSwKICAgIEVkaXRvclN0YXRlLmFsbG93TXVsdGlwbGVTZWxlY3Rpb25zLm9mKGZhbHNlKSwKICAgIHNlYXJjaCgpLAogICAga2V5bWFwLm9mKFsKICAgICAgLi4uc2VhcmNoS2V5bWFwCiAgICBdKQogIF0sCiAgcGFyZW50OiBkb2N1bWVudC5ib2R5Cn0pCg==

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