Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot delete more than 1 character with codemirror + vim mode, in insert mode. #3516

Closed
shantanugoel opened this issue Jul 17, 2020 · 2 comments · Fixed by #3522
Closed
Labels
bug It's a bug

Comments

@shantanugoel
Copy link

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.

@shantanugoel shantanugoel added the bug It's a bug label Jul 17, 2020
@laurent22
Copy link
Owner

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

@CalebJohn
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants