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 position lost when moving from long lines to shorter lines #626

Open
Bekaboo opened this issue Mar 31, 2023 · 0 comments
Open

Cursor position lost when moving from long lines to shorter lines #626

Bekaboo opened this issue Mar 31, 2023 · 0 comments

Comments

@Bekaboo
Copy link

Bekaboo commented Mar 31, 2023

Hi, thanks for your great work on this plugin!

I noticed a bug: when I move from a long line with cursor at, say, column 10, to a shorter line with length less than 10, the memorized largest horizontal cursor position will be "reset" to the horizontal position of the cursor on the shorter line, and will never come back to 10 after if the cursor is moved to a longer line.

To better explain the difference between the expected (default) behavior and the actual behavior, I make two screen recordings:

  • Expected behavior:

    simplescreenrecorder-2023-03-31_15.25.43.mp4
  • Actual behavior:

    simplescreenrecorder-2023-03-31_15.26.53.mp4

My suggestion is that it might be problem from setting window options on event CursorMoved, this can be considered as a vim bug, but currently it is possible to be effectively fixed by using winsaveview() and vinresetview(), to see why, please check the discussions here.

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