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

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

Open
MrMattBusby opened this issue May 6, 2024 · 0 comments

Comments

@MrMattBusby
Copy link

MrMattBusby commented May 6, 2024

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):

  • Extension (VsCodeVim) version: 1.27
  • VSCode version: 1.89
  • OS: Windows
  • This works natively VIM in MING64 and Unix versions 8.1 and 9.0.

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?

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

No branches or pull requests

1 participant