[vim/vim] scroll: 'smoothscroll' position is lost when the window height changes (PR #20885)
h_east (Vim Github Repository) <[email protected]> Thu, 30 Jul 2026 11:32:40 -0700
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/pull/[email protected]> |
```
Problem: With 'smoothscroll' the scroll position of a window is lost when
its height changes.
Solution: Only reset the skipped columns when 'smoothscroll' is off, where
they just serve to keep the cursor visible.
```
---
The height changes for ":split" and ":close", a 'cmdheight' change,
":resize" and every use of the autocommand window.
win_new_height() has reset w_skipcol since the Vim 7 import, when it only
existed to keep the cursor visible in a line too long for the window. With
'smoothscroll', added in patch 9.0.0640, it is the scroll position itself.
Found while investigating #12085, but a different problem: any height change
loses the position, not just the autocommand window. The todo.txt entry is
left untouched here to avoid a conflict with #20884.
Not fixed by this: ":help" followed by ":close", where the window is
squeezed to one line in between and the position cannot be kept, and
'splitkeep' "screen", which does not use this code path.
You can view, comment on, or merge this pull request online at:
https://github.com/vim/vim/pull/20885
-- Commit Summary --
* scroll: 'smoothscroll' position is lost when the window height changes
-- File Changes --
M src/testdir/test_scroll_opt.vim (24)
M src/window.c (13)
-- Patch Links --
https://github.com/vim/vim/pull/20885.patch
https://github.com/vim/vim/pull/20885.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/20885
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/20885%40github.com.