mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 10:31:48 +00:00
vim-patch:9.1.0526: Unwanted cursor movement with pagescroll at start of buffer (#29569)
Problem: Cursor is moved to bottom of window trying to pagescroll when
already at the start of the buffer (Asheq Imran, after v9.1.0357)
Solution: Don't move cursor when buffer content did not move.
(Luuk van Baal)
8ccb89016e
This commit is contained in:
@@ -2518,9 +2518,11 @@ int pagescroll(Direction dir, int count, bool half)
|
||||
? MAX(1, (int)p_window - 2) : get_scroll_overlap(dir));
|
||||
nochange = scroll_with_sms(dir, count, &count);
|
||||
|
||||
// Place cursor at top or bottom of window.
|
||||
validate_botline(curwin);
|
||||
curwin->w_cursor.lnum = (dir == FORWARD ? curwin->w_topline : curwin->w_botline - 1);
|
||||
if (!nochange) {
|
||||
// Place cursor at top or bottom of window.
|
||||
validate_botline(curwin);
|
||||
curwin->w_cursor.lnum = (dir == FORWARD ? curwin->w_topline : curwin->w_botline - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (get_scrolloff_value(curwin) > 0) {
|
||||
|
||||
Reference in New Issue
Block a user