timhor / obsidian-editor-shortcuts

Obsidian plugin to add keyboard shortcuts commonly found in code editors such as Visual Studio Code (vscode) or Sublime Text
MIT License
356 stars 25 forks source link

Multiple cursors doesn't work correctly with Japanese #78

Open misha opened 8 months ago

misha commented 8 months ago

Overview

Japanese IMEs (and other language IMEs that offer choices) allow you to use the arrow keys to select a replacement input while typing. Unfortunately, it's impossible to use multiple cursor editing with these languages right now because the cursors go away after discovering an initial selection.

I understand this is not high priority, but if there's a simple fix it would greatly improve this plugin for my purposes.

Reproduction

  1. Switch to Japanese IME.
  2. Use Ctrl+D to select multiple occurrences.
  3. Enter some Japanese for which the IME has options.
  4. Use the arrow keys at least twice, ie. select a second option.
  5. Hit enter.

Expected Behavior

I would expect all occurrences to match the final selected option.

Actual Behavior

The first occurrence matches the final option. The other occurrences only match the initial option.

Here's a short clip of the entire bug. As you can see, subsequent choices are not reflected in the other cursor occurrences. (I have added some periods to the first line to avoid having the IME input selection box cover the other items.)

https://github.com/timhor/obsidian-editor-shortcuts/assets/1068949/8a4a1fa7-f819-4048-b908-f8c6e1390bc0

PRO-2684 commented 6 months ago

Similar bug for Chinese IME... But I suppose multi-cursor is implemented by Obsidian, so this bug should be Obsidian's fault? (You can alt + click to insert multiple cursors natively on Obsidian)