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)

db4d88c2ad

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Luuk van Baal
2023-04-28 13:34:07 +02:00
parent 6fd7e3bea4
commit 9b9ccac625
3 changed files with 169 additions and 44 deletions

View File

@@ -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([[
<<<of text with lots of text with lots o|
f text with lots of text end |
^four |
~ |
~ |
|
]])
-- Test zt/zz/zb that they work properly when a long line is above it
feed('zb')
screen:expect([[
<<<th lots of text with lots of text wit|
h lots of text with lots of text with lo|
ts of text with lots of text with lots o|
f text with lots of text end |
^four |
|
]])
feed('zz')
screen:expect([[
<<<of text with lots of text with lots o|
f text with lots of text end |
^four |
~ |
~ |
|
]])
feed('zt')
screen:expect([[
^four |
~ |