mirror of
https://github.com/neovim/neovim.git
synced 2026-07-16 14:11:28 +00:00
vim-patch:9.1.1388: Scrolling one line too far with 'nosmoothscroll' page scrolling (#34023)
Problem: One-off error in "count" to make "w_skipcol" zero with
'nosmoothscroll' page scrolling when last virtual line
in a buffer line is exactly the entire window width.
(Hirohito Higashi)
Solution: Properly compute the smallest integer value necessary
to make "w_skipcol" zero (Luuk van Baal)
c6c72d165c
(cherry picked from commit f87b6230f1)
This commit is contained in:
committed by
github-actions[bot]
parent
d50f71d2f1
commit
27abf5c81b
@@ -2427,10 +2427,10 @@ static bool scroll_with_sms(Direction dir, int count, int *curscount)
|
||||
|
||||
int width1 = curwin->w_width_inner - win_col_off(curwin);
|
||||
int width2 = width1 + win_col_off2(curwin);
|
||||
count = 1 + (curwin->w_skipcol - width1) / width2;
|
||||
count = 1 + (curwin->w_skipcol - width1 - 1) / width2;
|
||||
if (fixdir == FORWARD) {
|
||||
count = 2 + (linetabsize_eol(curwin, curwin->w_topline)
|
||||
- curwin->w_skipcol - width1) / width2;
|
||||
count = 1 + (linetabsize_eol(curwin, curwin->w_topline)
|
||||
- curwin->w_skipcol - width1 + width2 - 1) / width2;
|
||||
}
|
||||
scroll_redraw(fixdir == FORWARD, count);
|
||||
*curscount += count * (fixdir == dir ? 1 : -1);
|
||||
|
||||
Reference in New Issue
Block a user