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
}
else
{
+ // scroll a text line down
--curwin->w_topline;
curwin->w_skipcol = 0;
#ifdef FEAT_DIFF
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