mirror of
https://github.com/neovim/neovim.git
synced 2024-12-26 06:05:06 -07:00
Merge pull request #29570 from neovim/backport-29569-to-release-0.10
vim-patch:9.1.0526: Unwanted cursor movement with pagescroll at start of buffer
This commit is contained in:
commit
5cad641848
@ -2520,9 +2520,11 @@ int pagescroll(Direction dir, int count, bool half)
|
|||||||
? MAX(1, (int)p_window - 2) : get_scroll_overlap(dir));
|
? MAX(1, (int)p_window - 2) : get_scroll_overlap(dir));
|
||||||
nochange = scroll_with_sms(dir, count, &count);
|
nochange = scroll_with_sms(dir, count, &count);
|
||||||
|
|
||||||
// Place cursor at top or bottom of window.
|
if (!nochange) {
|
||||||
validate_botline(curwin);
|
// Place cursor at top or bottom of window.
|
||||||
curwin->w_cursor.lnum = (dir == FORWARD ? curwin->w_topline : curwin->w_botline - 1);
|
validate_botline(curwin);
|
||||||
|
curwin->w_cursor.lnum = (dir == FORWARD ? curwin->w_topline : curwin->w_botline - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_scrolloff_value(curwin) > 0) {
|
if (get_scrolloff_value(curwin) > 0) {
|
||||||
|
@ -4267,6 +4267,9 @@ func Test_page_cursor_topbot()
|
|||||||
call assert_equal(18, line('.'))
|
call assert_equal(18, line('.'))
|
||||||
exe "norm! \<C-B>\<C-F>"
|
exe "norm! \<C-B>\<C-F>"
|
||||||
call assert_equal(9, line('.'))
|
call assert_equal(9, line('.'))
|
||||||
|
" Not when already at the start of the buffer.
|
||||||
|
exe "norm! ggj\<C-B>"
|
||||||
|
call assert_equal(2, line('.'))
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user