Joplin: Cannot delete more than 1 character with codemirror + vim mode, in insert mode.

Created on 17 Jul 2020  路  2Comments  路  Source: laurent22/joplin

Environment

Joplin version: 1.0.227 (Same behavior on 1.0.224 as well)
Platform: macOS
OS specifics: Version 10.15.5

Steps to reproduce

  1. Enable code mirror and vim mode in preferences
  2. Open a note and write some text (or open a note with some text present already)
  3. Go to any text, enter insert mode by pressing i. Cursor changes from block to vertical line to denote this.
  4. Press backspace/delete more than once. First delete press deletes one character. At the same time, cursor changes back to block (but we are still in insert mode). Any more delete presses don't do anything. Pressing escape and then going back to insert mode again allows to delete one more character and so on.

Describe what you expected to happen

Multiple delete keypresses should have deleted multiple characters.

Logfile

Not able to attach logfile as it seems to have names etc for my notes which have work related data. Please let me know if I can create a reduced version somehow to avoid adding such info.

bug

Most helpful comment

The issue happens in Editor.tsx when new props are received. The current implementation sets all necessary options and it looks like Codemirror has a bug where setting the keyMap (even if it hasn't changes) put's the vim editor in an unknown state. I'll follow up with a pull request that splits all the different options into different useEffect calls.

All 2 comments

Anything in the console? https://joplinapp.org/debugging

The issue happens in Editor.tsx when new props are received. The current implementation sets all necessary options and it looks like Codemirror has a bug where setting the keyMap (even if it hasn't changes) put's the vim editor in an unknown state. I'll follow up with a pull request that splits all the different options into different useEffect calls.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dimyself picture dimyself  路  308Comments

pcause picture pcause  路  60Comments

harmancasvi picture harmancasvi  路  34Comments

alexdevero picture alexdevero  路  43Comments

jcgerhard picture jcgerhard  路  43Comments