int width2 = width1 + curwin_col_off2();
int size = 0;
linenr_T prev_topline = curwin->w_topline;
+ colnr_T prev_skipcol = curwin->w_skipcol;
if (do_sms)
size = linetabsize(curwin, curwin->w_topline);
}
}
- if (curwin->w_topline == prev_topline)
- // need to redraw even though w_topline didn't change
+ if (curwin->w_topline == prev_topline
+ || curwin->w_skipcol != prev_skipcol)
+ // need to redraw because wl_size of the topline may now be invalid
redraw_later(UPD_NOT_VALID);
}
else
call setline(14, 'bbbb')
END
call writefile(lines, 'XSmoothIncsearch', 'D')
- let buf = RunVimInTerminal('-S XSmoothIncsearch', #{rows: 8, cols:40})
+ let buf = RunVimInTerminal('-S XSmoothIncsearch', #{rows: 8, cols: 40})
call term_sendkeys(buf, "/b")
call VerifyScreenDump(buf, 'Test_smooth_incsearch_1', {})
call StopVimInTerminal(buf)
endfunc
+" Test scrolling multiple lines and stopping at non-zero skipcol.
+func Test_smoothscroll_multi_skipcol()
+ CheckScreendump
+
+ let lines =<< trim END
+ setlocal cursorline scrolloff=0 smoothscroll
+ call setline(1, repeat([''], 9))
+ call setline(3, repeat('a', 50))
+ call setline(8, 'bbb')
+ call setline(9, 'ccc')
+ redraw
+ END
+ call writefile(lines, 'XSmoothMultiSkipcol', 'D')
+ let buf = RunVimInTerminal('-S XSmoothMultiSkipcol', #{rows: 10, cols: 40})
+ call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_1', {})
+
+ call term_sendkeys(buf, "3\<C-E>")
+ call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_2', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab