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 positions changes undeterminably while scrolling past it #127

Closed
MikeLemo1 opened this issue Dec 20, 2023 · 4 comments
Closed

Cursor positions changes undeterminably while scrolling past it #127

MikeLemo1 opened this issue Dec 20, 2023 · 4 comments

Comments

@MikeLemo1
Copy link

When I scroll and go part the cursor it changes/drags the Cursor position with it out of the initial state.
Is there a way to make it stay steady?

@dstein64
Copy link
Owner

Hi @MikeLemo1, can you provide steps to reproduce the issue? Is this for ordinary scrolling with the keyboard? If so, which keys are you pressing? Or is this for scrolling some other way (e.g., dragging scrollbars with the mouse)?

@MikeLemo1
Copy link
Author

Hi there @dstein64 Actually yeah it is scrolling with the mouse but I'd still like the cursor to be static with certain kinds of scrolling as I sometimes use the cursor as a temporary bookmark...

@dstein64
Copy link
Owner

dstein64 commented Feb 12, 2024

As of e1e3237, cursor position is retained while dragging.

I tried to implement cursor positioning in a manner similar to what happens with mouse wheel scrolling, but I was unable to get the updated cursor position to show during dragging (after dragging was not an issue).

There are a few scenarios where the cursor position is not retained. For example, if the line that the cursor is on after dragging is too short, the cursor may shift to the left. If the cursor starts towards the top of the window at the beginning of a buffer, the cursor may shift down after dragging, to accommodate scrolloff.

Additionally, there is an issue when the cursor ends on a line with concealed text from syntax highlighting, resulting in the cursor being incorrectly positioned left of where it should be (this can be seen on :help buffers, although the presence of tabs in those buffers can mask the problem). I believe the calculations the plugin performs are taking place prior to the concealcursor application. I don't know a way to properly adjust for that.

I've found that the cursor position is shown while dragging if there are not wrapped lines, but the cursor temporarily moves (for the duration of dragging) towards the bottom left of the window if there are wrapped lines.

@dstein64
Copy link
Owner

"Additionally, there is an issue when the cursor ends on a line with concealed text from syntax highlighting, resulting in the cursor being incorrectly positioned left of where it should be (this can be seen on :help buffers, although the presence of tabs in those buffers can mask the problem)."

I've fixed the problematic behavior that arose with concealed text.

The pending issue is that the cursor moves to the bottom left of the screen while dragging the scrollbar when lines are wrapped. I've opened #128 for that.

I'll close this Issue for now. @MikeLemo1, please let me know if the recent updates don't resolve the matter for you (excluding the aforementioned wrap problem that still exists, which has a new Issue).

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

2 participants