To: vim_dev@googlegroups.com Subject: Patch 9.0.0898 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0898 Problem: With 'smoothscroll' cursor is one screen line too far down. (Ernie Rael) Solution: Add a test that currently has the wrong result so that a fix can be made. (issue #11436) Files: src/testdir/test_scroll_opt.vim, src/testdir/dumps/Test_smooth_long_showbreak_1.dump, src/testdir/dumps/Test_smooth_long_showbreak_2.dump *** ../vim-9.0.0897/src/testdir/test_scroll_opt.vim 2022-11-17 12:41:38.350199459 +0000 --- src/testdir/test_scroll_opt.vim 2022-11-17 18:56:34.703443468 +0000 *************** *** 308,313 **** --- 308,336 ---- call StopVimInTerminal(buf) endfunc + func Test_smoothscroll_long_line_showbreak() + CheckScreendump + + let lines =<< trim END + vim9script + # a line that spans four screen lines + setline(1, 'with lots of text in one line '->repeat(6)) + set smoothscroll scrolloff=0 showbreak=+++\ + END + call writefile(lines, 'XSmoothLongShowbreak', 'D') + let buf = RunVimInTerminal('-S XSmoothLongShowbreak', #{rows: 6, cols: 40}) + call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {}) + + " FIXME: this currently has the cursor in screen line 2, should be one up. + call term_sendkeys(buf, "\") + call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_2', {}) + + call term_sendkeys(buf, "0") + call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {}) + + call StopVimInTerminal(buf) + endfunc + " Test that if the current cursor is on a smooth scrolled line, we correctly " reposition it. Also check that we don't miscalculate the values by checking " the consistency between wincol() and col('.') as they are calculated *** ../vim-9.0.0897/src/testdir/dumps/Test_smooth_long_showbreak_1.dump 2022-11-17 18:59:40.927187873 +0000 --- src/testdir/dumps/Test_smooth_long_showbreak_1.dump 2022-11-17 18:55:23.091568481 +0000 *************** *** 0 **** --- 1,6 ---- + >w+0&#ffffff0|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| + |++0#4040ff13&@2| |o+0#0000000&|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x + |++0#4040ff13&@2| |t+0#0000000&| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o + |++0#4040ff13&@2| |n+0#0000000&|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n + |++0#4040ff13&@2| |e+0#0000000&| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| @4 + @22|1|,|1| @10|A|l@1| *** ../vim-9.0.0897/src/testdir/dumps/Test_smooth_long_showbreak_2.dump 2022-11-17 18:59:40.931187869 +0000 --- src/testdir/dumps/Test_smooth_long_showbreak_2.dump 2022-11-17 18:55:21.939570641 +0000 *************** *** 0 **** --- 1,6 ---- + |++0#4040ff13#ffffff0@2| |o+0#0000000&|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x + |++0#4040ff13&@2| >t+0#0000000&| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o + |++0#4040ff13&@2| |n+0#0000000&|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n + |++0#4040ff13&@2| |e+0#0000000&| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| @4 + |~+0#4040ff13&| @38 + | +0#0000000&@21|1|,|7@1|-|8|5| @6|A|l@1| *** ../vim-9.0.0897/src/version.c 2022-11-17 18:30:13.184184301 +0000 --- src/version.c 2022-11-17 18:58:08.915302947 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 898, /**/ -- Warning label on a superhero Halloween costume: "Caution: Cape does not enable user to fly." /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///