codemirror-vim icon indicating copy to clipboard operation
codemirror-vim copied to clipboard

`j` in visual mode renders offset to actual line when there is empty lines

Open zzhixin opened this issue 10 months ago • 0 comments

Description

If there is empty lines, in visual mode, the cursor renders one line offset to the actual line. codemirror-vim

Expected behavior

In the gif above, after pressing j, the cursor should be at the second line rather than the end of the first line. After pressing 2xj, the cursor should be at the third line rather than the second line.

Although the cursor get right after pressing 3xj, the behavior is weird that the cursor goes 2 lines downward at the last j stroke.

Reproduce

  1. Open sandbox
  2. Delete default content, enter
This is a test.


This is another test.
  1. press ggVjjj.

Comment

What is interesting is that in codemirror5, no such bug.

zzhixin avatar Mar 28 '24 05:03 zzhixin