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

Implement stickyCursor #3945

Closed
wants to merge 1 commit into from
Closed

Implement stickyCursor #3945

wants to merge 1 commit into from

Conversation

J-Fields
Copy link
Member

@J-Fields J-Fields commented Aug 5, 2019

What this PR does / why we need it:
This new setting emulates vim's limitation (or feature, depending on how you look at it) which kept the cursor within the viewport, even when scrolling with the mouse.

Which issue(s) this PR fixes
Fixes #873, #3846

Special notes for your reviewer:
This is a simple change, but not a particularly auto-testable one, so I'd appreciate some manual testing. A known issue is that the column position of the cursor isn't guaranteed to stay consistent. I may address that in the future, but I'd say this is good enough for now.

@juanlanus
Copy link

It's good! There are a few details:

Shy of the last line
Try G (go bottom) z. (center horizontally) ^y (scroll up): the pointer moves up one line, that further ^y work fine.

Not working if scrolling with the mouse wheel
Click in the middle of the screen, then scroll with the wheel: the cursor goes away.
When scrolling with ^y and ^e it works perfectly.

The cursor moves to the first char of the line
Try $ (go to EOL) then many up arrow or down arrow: the cursor sticks the the end of the line no matter its length.

Or try 20| to sit on col 20 and use many up or down arrows: the cursor stays at col 20 except for shorter lines.

Now try to push the cursor out of the screen with ^y or ^e: the cursor forgets its position and ssits in the first char of each line.

Finally
It is really much better for us who are using this funny editor since so many years ago. Thanks!

@J-Fields
Copy link
Member Author

J-Fields commented Aug 6, 2019

I appreciate the feedback, @juanlanus. Scrolling with the mouse was working for me when I tried it earlier; I'll double check that and try to fix those edge cases as well when I get a chance.

This setting emulates vim's limitation (or feature, depending on how you look at it) which kept the cursor within the viewport, even when scrolling with the mouse.
Fixes #873, #3846
@juanlanus
Copy link

@J-Fields Pls let me know so I can test it ASAP. Thanks!

@J-Fields J-Fields self-assigned this Nov 19, 2019
@J-Fields J-Fields closed this Mar 16, 2021
@cevhyruz
Copy link

cevhyruz commented Jul 2, 2022

@J-Fields. any update on this? Why was this closed?

@yyyar
Copy link

yyyar commented Feb 9, 2023

+1 Would it be merged please? It's a great feature.

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

Successfully merging this pull request may close these issues.

Mouse scrolling does not bring cursor
4 participants