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/functional/legacy/scroll_opt_spec.lua | 42 ++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'test/functional') diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua index 3320f96668..bb0ada15e9 100644 --- a/test/functional/legacy/scroll_opt_spec.lua +++ b/test/functional/legacy/scroll_opt_spec.lua @@ -865,6 +865,48 @@ describe('smoothscroll', function() ]]) end) + -- oldtest: Test_smoothscroll_multi_skipcol() + it('scrolling mulitple lines and stopping at non-zero skipcol', function() + screen:try_resize(40, 10) + screen:set_default_attr_ids({ + [0] = {foreground = Screen.colors.Blue, bold = true}, + [1] = {background = Screen.colors.Grey90}, + }) + exec([[ + 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 + ]]) + screen:expect([[ + {1:^ }| + | + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + aaaaaaaaaa | + | + | + | + | + bbb | + | + ]]) + feed('3') + screen:expect([[ + {0:<<<}{1:aaaaaa^a }| + | + | + | + | + bbb | + ccc | + {0:~ }| + {0:~ }| + | + ]]) + end) + it("works with virt_lines above and below", function() screen:try_resize(55, 7) exec([=[ -- 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/functional/legacy/scroll_opt_spec.lua | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'test/functional') diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua index bb0ada15e9..a5a6aded79 100644 --- a/test/functional/legacy/scroll_opt_spec.lua +++ b/test/functional/legacy/scroll_opt_spec.lua @@ -874,10 +874,11 @@ describe('smoothscroll', function() }) exec([[ 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 ]]) screen:expect([[ @@ -885,8 +886,8 @@ describe('smoothscroll', function() | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| aaaaaaaaaa | - | - | + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + aaaaaaaaaa | | | bbb | @@ -895,13 +896,26 @@ describe('smoothscroll', function() feed('3') screen:expect([[ {0:<<<}{1:aaaaaa^a }| + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + aaaaaaaaaa | | | + bbb | + ccc | + {0:~ }| + {0:~ }| + | + ]]) + feed('2') + screen:expect([[ + {0:<<<}{1:aaaaaa^a }| | | bbb | ccc | {0:~ }| + {0:~ }| + {0:~ }| {0:~ }| | ]]) -- cgit