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

smoothscroll down never leaves the line when scrolloff non zero #14726

Closed
errael opened this issue May 7, 2024 · 6 comments
Closed

smoothscroll down never leaves the line when scrolloff non zero #14726

errael opened this issue May 7, 2024 · 6 comments
Labels

Comments

@errael
Copy link
Contributor

errael commented May 7, 2024

Steps to reproduce

On a long line, continually doing gj never leaves the line. When you get close to the end of the long line, the first chars of the long line appear at the top of screen. Attached a file, but I'd guess any old file with a long line works.

gvim -u NONE -U NONE <attached_file>
set smoothscroll
set lines=22
set display=truncate
set scrolloff=3
map j gj

NOTE: change to set scrolloff=0 and it works OK.

Additionally, being at the top line of the file, doing the first gj end up on the third display line. There is no way to easily place the cursor on the first display lines.

long-line.txt

Expected behaviour

Going down one line goes down one display line.

Version of Vim

9.1.393

Environment

ubuntu/gtk

Logs and stack traces

No response

@errael errael added the bug label May 7, 2024
@errael
Copy link
Contributor Author

errael commented May 15, 2024

Since there is a simple workaround, do :set so=0, when you run into this issue, it's not serious. The recent smoothscroll infinite loop, #14750, reminds me of this; but this is not a vim infinite loop, more of a user loop:-)

@luukvbaal I'm only asking about this issue now to make sure it is seen. I vaguely recall something about known issues with smoothscroll and scrolloff. I couldn't find the issue; if there is one then this can be closed as duplicate.

@luukvbaal
Copy link
Contributor

I noticed the issue(and kept it in my inbox) but it might be a while before I will be able to look into it. I don't think there are any other open smoothscroll issues currently.

@luukvbaal
Copy link
Contributor

but it might be a while before I will be able to look into it.

I lied, I looked into it right after writing this and fell down the smoothscroll rabbit hole once I established that this was caused by a regression in #14410.

#14783 fixes the two problems mentioned here, and fixes one screen issue with sms + scrolloff near the end of a line(also present before #14410), while noting some additional screen problems...

@errael
Copy link
Contributor Author

errael commented May 16, 2024

down the smoothscroll rabbit hole

I turned this feature on when Bram first released it; I've seen some very bizzare things...

I tried this patch, works for me,
Thanks.

@luukvbaal
Copy link
Contributor

I turned this feature on when Bram first released it; I've seen some very bizzare things...

Haha same, but I meant in the code; it is still quite messy...

I tried this patch, works for me, Thanks.

Thanks for confirming the fix.

@errael
Copy link
Contributor Author

errael commented May 16, 2024

meant in the code

Me too, kind of. Assuming vim is a holographic universe, and considering what I've seen as a user for smoothscroll evolution over the last year, I'm thinking as a programmer you've seen...

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

Successfully merging a pull request may close this issue.

2 participants