vim-patch:9.1.0215: Half-page scrolling does not support smooth-scrolling

Problem:  Page-wise scrolling with Ctrl-D/Ctrl-U implements
          it's own logic to change the topline and cursor.
          More logic than necessary for scrolling with Ctrl-F/Ctrl-B
          was removed in patch 9.1.0211.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y/Ctrl-F/Ctrl-B while
          staying backward compatible as much as possible.
          Restore some of the logic that determined how many lines will
          be scrolled (Luuk van Baal)

5a2e3ec9ac
This commit is contained in:
Luuk van Baal
2024-03-28 10:20:45 +01:00
parent 4147302f4b
commit 2f638c0ac6
11 changed files with 159 additions and 178 deletions

View File

@@ -4193,7 +4193,7 @@ static void ins_pageup(void)
}
pos_T tpos = curwin->w_cursor;
if (onepage(BACKWARD, 1) == OK) {
if (pagescroll(BACKWARD, 1, false) == OK) {
start_arrow(&tpos);
can_cindent = true;
} else {
@@ -4238,7 +4238,7 @@ static void ins_pagedown(void)
}
pos_T tpos = curwin->w_cursor;
if (onepage(FORWARD, 1) == OK) {
if (pagescroll(FORWARD, 1, false) == OK) {
start_arrow(&tpos);
can_cindent = true;
} else {