vim-patch:9.0.0707: with 'smoothscroll' cursor position not adjusted in long line

Problem:    With 'smoothscroll' and 'scrolloff' non-zero the cursor position
            is not properly adjusted in a long line.
Solution:   Move the cursor further up or down in the line.

118c235112

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Luuk van Baal
2023-04-26 22:15:25 +02:00
parent f3de7f4468
commit 36c98b47a3
3 changed files with 83 additions and 10 deletions

View File

@@ -395,5 +395,47 @@ describe('smoothscroll', function()
f text wi^th lots of text with lots of te|
|
]])
-- 'scrolloff' set to 1, scrolling up, cursor moves screen line down
exec('set scrolloff=1')
feed('10|<C-E>')
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 with lots of te|
xt with lots of text with lots of text w|
|
]])
-- 'scrolloff' set to 1, scrolling down, cursor moves screen line up
feed('<C-E>gjgj<C-Y>')
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 wi^th lots of text with lots of te|
xt with lots of text with lots of text w|
|
]])
-- 'scrolloff' set to 2, scrolling up, cursor moves screen line down
exec('set scrolloff=2')
feed('10|<C-E>')
screen:expect([[
<<<th lots of text with lots of text wit|
h lots of text with lots of text with lo|
ts of tex^t with lots of text with lots o|
f text with lots of text with lots of te|
xt with lots of text with lots of text w|
|
]])
-- 'scrolloff' set to 2, scrolling down, cursor moves screen line up
feed('<C-E>gjgj<C-Y>')
screen:expect([[
<<<of text with lots of text with lots o|
f text with lots of text with lots of te|
xt with l^ots of text with lots of text w|
ith lots of text with lots of text with |
lots of text with lots of text with lots|
|
]])
end)
end)