From 3b2bd8d69e6c0a173562778fae6ece67d9adf52c Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sat, 6 May 2023 17:33:42 +0200 Subject: vim-patch:9.0.1512: inserting lines when scrolling with 'smoothscroll' set Problem: Inserting lines when scrolling with 'smoothscroll' set. Solution: Adjust line height computation for w_skipcol. (Luuk van Baal, closes vim/vim#12350) https://github.com/vim/vim/commit/c8502f9b880b6d23baa4f9d28b60e1ceb442e35f --- test/old/testdir/test_scroll_opt.vim | 27 ++++++++++++++++++++++++++- 1 file changed, 26 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 8402fa51e2..e8c4c71b60 100644 --- a/test/old/testdir/test_scroll_opt.vim +++ b/test/old/testdir/test_scroll_opt.vim @@ -587,7 +587,7 @@ func Test_smoothscroll_mouse_pos() endfunc " this was dividing by zero -func Test_smoothscrol_zero_width() +func Test_smoothscroll_zero_width() CheckScreendump let lines =<< trim END @@ -613,5 +613,30 @@ func Test_smoothscrol_zero_width() call StopVimInTerminal(buf) endfunc +" this was unnecessarily inserting lines +func Test_smoothscroll_ins_lines() + CheckScreendump + + let lines =<< trim END + set wrap + set smoothscroll + set scrolloff=0 + set conceallevel=2 + call setline(1, [ + \'line one' .. 'with lots of text in one line '->repeat(2), + \'line two', + \'line three', + \'line four', + \'line five' + \]) + END + call writefile(lines, 'XSmoothScrollInsLines', 'D') + let buf = RunVimInTerminal('-S XSmoothScrollInsLines', #{rows: 6, cols: 40}) + + call term_sendkeys(buf, "\gjgk") + call VerifyScreenDump(buf, 'Test_smooth_ins_lines', {}) + + call StopVimInTerminal(buf) +endfunc " vim: shiftwidth=2 sts=2 expandtab -- cgit From 8e74569d7ee170b8661bdc74d61cf6be95303060 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sat, 6 May 2023 19:24:45 +0200 Subject: vim-patch:9.0.1513: text scrolls unnecessarily when splitting Problem: Text scrolls unnecessarily when splitting and 'splitkeep' is not "cursor". Solution: Avoid resetting w_skipcol. (Luuk van Baal, closes vim/vim#12334) https://github.com/vim/vim/commit/b926bf47d61360a4ec5e4867714a08d70fd49965 --- test/old/testdir/test_window_cmd.vim | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/old/testdir') diff --git a/test/old/testdir/test_window_cmd.vim b/test/old/testdir/test_window_cmd.vim index f18d1719c0..d4ff241366 100644 --- a/test/old/testdir/test_window_cmd.vim +++ b/test/old/testdir/test_window_cmd.vim @@ -1879,6 +1879,23 @@ func Test_splitkeep_status() call StopVimInTerminal(buf) endfunc +" skipcol is not reset unnecessarily and is copied to new window +func Test_splitkeep_skipcol() + CheckScreendump + + let lines =<< trim END + set splitkeep=topline smoothscroll splitbelow scrolloff=0 + call setline(1, 'with lots of text in one line '->repeat(6)) + norm 2 + wincmd s + END + + call writefile(lines, 'XTestSplitkeepSkipcol', 'D') + let buf = RunVimInTerminal('-S XTestSplitkeepSkipcol', #{rows: 12, cols: 40}) + + call VerifyScreenDump(buf, 'Test_splitkeep_skipcol_1', {}) +endfunc + func Test_new_help_window_on_error() help change.txt execute "normal! /CTRL-@\" -- cgit