Page MenuHomePhabricator

Toolbar/charinsert don't handle CodeMirror's multiple selections/cursors
Open, Needs TriagePublic

Description

Steps to reproduce:

  1. Edit any wiki page in normal mode, like https://en.wikipedia.org/w/index.php?title=Wikipedia&action=edit&section=1, with CodeMirror on.
  2. Select two words in different places: select one word with the mouse, press Ctrl (⌘ on Mac), select another word.
  3. Press B icon on the toolbar to bold them.

Expected result:
Words become enclosed in ''', like this:

Actual result:
Both words are inserted into both cursor positions, like this:

Browser: Chrome on Windows 10.

The same applies to the <charinsert> tags.

Note that the new wikitext mode doesn't seem to support multiple cursors.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Jack_who_built_the_house renamed this task from Toolbar/charinsert don't handle CodeMirrors's multiple selections/cursors to Toolbar/charinsert don't handle CodeMirror's multiple selections/cursors.Dec 5 2018, 2:34 PM
Jack_who_built_the_house updated the task description. (Show Details)

Wow never knew CodeMirror supported this.. impressive. (cmd instead of ctrl on MacOSX btw).

Not sure if this can be supported, as jQuery.textSelection only supports a single selection.