mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user