From 9978a9996dae9b62763db6772e7f1f777caacb45 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 6 Jun 2023 06:26:13 +0800 Subject: vim-patch:9.0.1603: display wrong if scrolling multiple lines with 'smoothscroll' Problem: Display wrong when scrolling multiple lines with 'smoothscroll' set. Solution: Redraw when w_skipcol changed. (closes vim/vim#12477, closes vim/vim#12468) https://github.com/vim/vim/commit/3c802277604a6b21110e41bedfe4c937ba7c2b7d --- test/old/testdir/test_scroll_opt.vim | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'test/old/testdir') diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim index 48b8cb301f..1cd8bbfc84 100644 --- a/test/old/testdir/test_scroll_opt.vim +++ b/test/old/testdir/test_scroll_opt.vim @@ -780,7 +780,7 @@ func Test_smoothscroll_incsearch() 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', {}) @@ -795,4 +795,26 @@ func Test_smoothscroll_incsearch() 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\") + call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_2', {}) + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab -- cgit From fc908b500683215085ee6c12b41aa227332b7bbe Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 6 Jun 2023 06:34:02 +0800 Subject: vim-patch:9.0.1610: display is wrong when 'smoothscroll' is set Problem: Display is wrong when 'smoothscroll' is set and scrolling multiple lines. Solution: Redraw with UPD_NOT_VALID when "skipcol" is or was set. (closes vim/vim#12490, closes vim/vim#12468) https://github.com/vim/vim/commit/d9a92dc70b20c76cef9ca186676583c92c14311c --- test/old/testdir/test_scroll_opt.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'test/old/testdir') diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim index 1cd8bbfc84..f9f33b20eb 100644 --- a/test/old/testdir/test_scroll_opt.vim +++ b/test/old/testdir/test_scroll_opt.vim @@ -801,10 +801,11 @@ func Test_smoothscroll_multi_skipcol() let lines =<< trim END setlocal cursorline scrolloff=0 smoothscroll - call setline(1, repeat([''], 9)) + call setline(1, repeat([''], 8)) call setline(3, repeat('a', 50)) - call setline(8, 'bbb') - call setline(9, 'ccc') + call setline(4, repeat('a', 50)) + call setline(7, 'bbb') + call setline(8, 'ccc') redraw END call writefile(lines, 'XSmoothMultiSkipcol', 'D') @@ -814,6 +815,9 @@ func Test_smoothscroll_multi_skipcol() call term_sendkeys(buf, "3\") call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_2', {}) + call term_sendkeys(buf, "2\") + call VerifyScreenDump(buf, 'Test_smooth_multi_skipcol_3', {}) + call StopVimInTerminal(buf) endfunc -- cgit