From 9b9ccac62563326c1ad59a403aa89851a379ddbb Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Fri, 28 Apr 2023 13:34:07 +0200 Subject: vim-patch:9.0.1121: cursor positioning and display problems with 'smoothscroll' Problem: Cursor positioning and display problems with 'smoothscroll' and using "zt", "zb" or "zz". Solution: Adjust computations and conditions. (Yee Cheng Chin, closes vim/vim#11764) https://github.com/vim/vim/commit/db4d88c2adfe8f8122341ac9d6cae27ef78451c8 Co-authored-by: Bram Moolenaar --- test/functional/legacy/scroll_opt_spec.lua | 28 ++++++++++++++++++++++++++++ test/old/testdir/test_scroll_opt.vim | 12 ++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua index 31d851f571..e58b95ecc1 100644 --- a/test/functional/legacy/scroll_opt_spec.lua +++ b/test/functional/legacy/scroll_opt_spec.lua @@ -499,6 +499,34 @@ describe('smoothscroll', function() -- and since this is a really long line, it will be put on top of the screen. exec('set scrolloff=0') feed('0j') + screen:expect([[ + <<repeat(10)) .. ' end', 'four'])\") call term_sendkeys(buf, "3Gzt") call term_sendkeys(buf, "j") - call VerifyScreenDump(buf, 'Test_smooth_long_11', {}) + call VerifyScreenDump(buf, 'Test_smooth_long_14', {}) " Repeat the step but this time start it when the line is smooth-scrolled by " one line. This tests that the offset calculation is still correct and @@ -328,7 +336,7 @@ func Test_smoothscroll_wrap_long_line() " screen. call term_sendkeys(buf, "3Gzt") call term_sendkeys(buf, "\j") - call VerifyScreenDump(buf, 'Test_smooth_long_12', {}) + call VerifyScreenDump(buf, 'Test_smooth_long_15', {}) call StopVimInTerminal(buf) endfunc -- cgit