VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.57k stars 1.3k forks source link

Cursor horizontal character column position not restored when vertically navigating lines with 'j' or 'k' "jk", :startofline desiredColumn #9019

Open MrMattBusby opened 2 months ago

MrMattBusby commented 2 months ago

Describe the bug When navigating vertically using, e.g. j and k, the cursor's horizontal position (column) isn't restored after navigating through a shorter line.

To Reproduce Steps to reproduce the behavior: Normal mode:

1)  int variable1[*4]; // Cursor starts on "4"
2)  char c[3]*;        // Use "j" twice past this shorter line, cursor is moved to end of this line
3)  int variable2[*6]; // Should end up on "6" (does in VIM on MING and Unix)
3') int varia*ble2[6]; // On VSCodeVim you end up here instead directly below the line 2's ";"

the cursor's column position was reset by navigating vertically but should have saved the "intended" column from earlier.

Expected behavior The horizontal cursor position should be restored when navigating between lines of different lengths.

Native VIM behavior. See :help startofline: "cusor is kept in the same column (if possible)".

What I've Tried Playing with wrapping like vim.foldfix:false, and set for sol and compatible didn't fix.

Workaround !!

Environment (please complete the following information):

Additional context VIM which "set" setting maintains cursor horizontal character position when navigating up/down lines?

Related

Maybe these are all related and could be merged?