-
Notifications
You must be signed in to change notification settings - Fork 30
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
Vim normal-mode cursor disappears when moving over multi-codepoint emoji #143
Comments
I suspect this is related to the problem that atomic ranges does not work in the normal mode. https://forum.obsidian.md/t/cm6-are-vim-mode-atomic-ranges-compatible/69667 |
I think I figured out why it happens. CM6's moveByChar skips atoms (https://github.com/codemirror/view/blob/e6a55a6515521a84e709f02b4eb32e57aebbbfba/src/editorview.ts#L641), while codemirror-vim's moveByCharacters doesn't. |
I was able to fix this regarding cursor motions ( But I'm not sure how I can fix this regarding deletion. |
Base CM forward deletes atomically, while backspace deletes the characters separately. I wonder if there's code from base CM that could be referenced to atomically delete. @RyotaUshio, would it make sense to submit the motion patch as a PR ahead of figuring out the deletion part? |
@firai I might make sense, but to be honest, I currently can't find enough time to fill in the (a little bit strict) PR template. |
Obsidian has recently released v1.5.3, which includes the fix for this problem. |
@RyotaUshio I checked the latest version and it resolves the issue except in the case where the emoji is at the end of the line. In that case the cursor still moves twice over the emoji character and disappears when at the very end of the line. |
Originally reported as an issue w/ Obsidian.
Steps to Reproduce
Using sandbox editor:
Expected result
The cursor moves over the emoji just like non-emoji text.
Actual result
After initially highlighting the emoji character, the cursor disappears on its next move (or next several depending on the number of codepoints) and eventually reappears once it is moved to the subsequent character.
Screen.Recording.2023-10-06.at.2.21.37.PM.mov
The text was updated successfully, but these errors were encountered: