aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/scroll_opt_spec.lua
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-04-26 22:15:25 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-05-02 13:11:47 +0200
commit36c98b47a3526dc61d149f951f8b8e3a677c26eb (patch)
tree45487f425ea6f65497a7ba434161f63bf634d49b /test/functional/legacy/scroll_opt_spec.lua
parentf3de7f44685c8ec99c1f5c7a624a668044c5aa19 (diff)
downloadrneovim-36c98b47a3526dc61d149f951f8b8e3a677c26eb.tar.gz
rneovim-36c98b47a3526dc61d149f951f8b8e3a677c26eb.tar.bz2
rneovim-36c98b47a3526dc61d149f951f8b8e3a677c26eb.zip
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. https://github.com/vim/vim/commit/118c235112854f34182d968613d7fe98be3b290b Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/functional/legacy/scroll_opt_spec.lua')
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 5c7c9cd55a..be7d324908 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -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)