diff options
-rw-r--r-- | src/move.c | 8 | ||||
-rw-r--r-- | src/testdir/test_scroll_opt.vim | 13 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 21 insertions, 2 deletions
diff --git a/src/move.c b/src/move.c index dca77f787..43e3273e2 100644 --- a/src/move.c +++ b/src/move.c @@ -1485,11 +1485,14 @@ scrolldown( else #endif { - if (curwin->w_topline == 1 && curwin->w_skipcol < width1) + // break when at the very top + if (curwin->w_topline == 1 + && (!curwin->w_p_sms || curwin->w_skipcol < width1)) break; if (curwin->w_p_wrap && curwin->w_p_sms - && curwin->w_skipcol >= width1) + && curwin->w_skipcol >= width1) { + // scroll a screen line down if (curwin->w_skipcol >= width1 + width2) curwin->w_skipcol -= width2; else @@ -1499,6 +1502,7 @@ scrolldown( } else { + // scroll a text line down --curwin->w_topline; curwin->w_skipcol = 0; #ifdef FEAT_DIFF diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim index f034d3a23..876ccf203 100644 --- a/src/testdir/test_scroll_opt.vim +++ b/src/testdir/test_scroll_opt.vim @@ -37,6 +37,19 @@ func Test_reset_scroll() quit! endfunc +func Test_CtrlE_CtrlY_stop_at_end() + enew + call setline(1, ['one', 'two']) + set number + exe "normal \<C-Y>" + call assert_equal([" 1 one "], ScreenLines(1, 10)) + exe "normal \<C-E>\<C-E>\<C-E>" + call assert_equal([" 2 two "], ScreenLines(1, 10)) + + bwipe! + set nonumber +endfunc + func Test_smoothscroll_CtrlE_CtrlY() CheckScreendump diff --git a/src/version.c b/src/version.c index 32a9851c8..0cf367ea6 100644 --- a/src/version.c +++ b/src/version.c @@ -700,6 +700,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 645, +/**/ 644, /**/ 643, |