To: vim_dev@googlegroups.com Subject: Patch 8.2.2495 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2495 Problem: Text jumps up and down when moving the cursor in a small window with wrapping text and 'scrolloff' set. Solution: Adjust the computation of w_skipcol. (partly by Ghjuvan Lacambre, closes #7813) Files: src/move.c, src/testdir/test_breakindent.vim *** ../vim-8.2.2494/src/move.c 2020-12-23 14:35:56.963016983 +0100 --- src/move.c 2021-02-10 20:27:55.308110184 +0100 *************** *** 1125,1134 **** n = curwin->w_wrow + so; else n = p_lines; ! if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width) extra += 2; ! if (extra == 3 || p_lines < so * 2) { // not enough room for 'scrolloff', put cursor in the middle n = curwin->w_virtcol / width; --- 1125,1134 ---- n = curwin->w_wrow + so; else n = p_lines; ! if ((colnr_T)n >= curwin->w_height + curwin->w_skipcol / width - so) extra += 2; ! if (extra == 3 || p_lines <= so * 2) { // not enough room for 'scrolloff', put cursor in the middle n = curwin->w_virtcol / width; *** ../vim-8.2.2494/src/testdir/test_breakindent.vim 2020-08-12 18:50:31.871655841 +0200 --- src/testdir/test_breakindent.vim 2021-02-10 21:09:19.406520731 +0100 *************** *** 634,640 **** call s:compare_lines(expect, lines) " Scroll down one screen line setl scrolloff=5 ! norm! 5gj redraw! let lines = s:screen_lines(1, 20) let expect = [ --- 634,640 ---- call s:compare_lines(expect, lines) " Scroll down one screen line setl scrolloff=5 ! norm! 6gj redraw! let lines = s:screen_lines(1, 20) let expect = [ *** ../vim-8.2.2494/src/version.c 2021-02-10 19:22:12.132400451 +0100 --- src/version.c 2021-02-10 20:32:09.639523706 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2495, /**/