[vim/vim] scroll: 'smoothscroll' position is lost when the window is squeezed (PR #20892)
h_east (Vim Github Repository) <[email protected]> Fri, 31 Jul 2026 01:27:19 -0700
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/pull/[email protected]> |
```
Problem: With 'smoothscroll' the scroll position in a long line is lost when
a window is temporarily squeezed to a couple of lines, for example
when opening and closing a help window.
Solution: When the cursor ends up in the skipped columns, skip up to the
screen line the cursor is in instead of showing the start of the
line.
```
---
To reproduce, with 'smoothscroll' and a line longer than the window:
exe "norm! gg10\<C-E>"
new
wincmd _
close
The window was scrolled back to the start of the line. ":help" followed by
":close" does the same when the help window leaves little room.
Not fixed by this: while the window is squeezed the skipped columns are
adjusted to keep the cursor visible, which is correct, so the position can
end up one screen line off. Restoring it exactly needs the saved values
that the todo.txt entry asks for, that entry stays as it is.
You can view, comment on, or merge this pull request online at:
https://github.com/vim/vim/pull/20892
-- Commit Summary --
* scroll: 'smoothscroll' position is lost when the window is squeezed
-- File Changes --
M src/move.c (20)
M src/testdir/test_scroll_opt.vim (21)
-- Patch Links --
https://github.com/vim/vim/pull/20892.patch
https://github.com/vim/vim/pull/20892.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/20892
You are receiving this because you are subscribed to this thread.
Message ID: <vim/vim/pull/[email protected]>
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/20892%40github.com.