diff options
| author | Volodymyr Chernetskyi <volodymyr_chernetskyi@goodyear.com> | 2026-09-04 09:27:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-04 03:27:53 -0400 |
| commit | 034fca6c539ce33760cad3d01db5e8473f61c4ac (patch) | |
| tree | 38348f846f585c8533af1ff6b6fb5ed1972ef79d /runtime/lua/vim/async/_queue.lua | |
| parent | 5209695703db4096923c203f235d78aec0cbdec8 (diff) | |
| download | rneovim-034fca6c539ce33760cad3d01db5e8473f61c4ac.tar.gz rneovim-034fca6c539ce33760cad3d01db5e8473f61c4ac.tar.bz2 rneovim-034fca6c539ce33760cad3d01db5e8473f61c4ac.zip | |
fix(move): zz does not center the cursor with wrapped lines #41656
Problem:
`scroll_cursor_halfway()` resets its `above` and `below` row counters on
every iteration of the `topline` scan, because they are declared inside
the loop. Each iteration then takes one line from each side regardless
of how many screen rows those lines occupy, so tall wrapped lines below
the cursor leave it near the top of the window instead of centered.
Affects the default `nosmoothscroll` path, reached from "zz" and from
`update_topline()`. Regression from 9b9ccac6256 (vim-patch:9.0.1121),
which moved the declarations to their first use while porting; the
upstream patch did not touch them.
Solution:
Declare the counters at function scope, as Vim does, so they accumulate
across iterations.
Diffstat (limited to 'runtime/lua/vim/async/_queue.lua')
0 files changed, 0 insertions, 0 deletions