aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-04-26 21:56:31 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-05-02 13:11:46 +0200
commitf3de7f44685c8ec99c1f5c7a624a668044c5aa19 (patch)
tree99447bca949e693b2829fc588211bea1e2acaa1e /test/functional
parent2918720addd3837abcf06f457e8e2cf674ece5e7 (diff)
downloadrneovim-f3de7f44685c8ec99c1f5c7a624a668044c5aa19.tar.gz
rneovim-f3de7f44685c8ec99c1f5c7a624a668044c5aa19.tar.bz2
rneovim-f3de7f44685c8ec99c1f5c7a624a668044c5aa19.zip
vim-patch:9.0.0701: with 'smoothscroll' cursor position not adjusted in long line
Problem: With 'smoothscroll' the cursor position s not adjusted in a long line. Solution: Move the cursor further up or down in the line. https://github.com/vim/vim/commit/8cf3459878198c5bb4a96f3c63214b2beccce341 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua56
1 files changed, 56 insertions, 0 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index fb4990ff00..5c7c9cd55a 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -340,4 +340,60 @@ describe('smoothscroll', function()
|
]])
end)
+
+ -- oldtest: Test_smoothscroll_wrap_long_line()
+ it("adjusts the cursor position in a long line", function()
+ screen:try_resize(40, 6)
+ exec([[
+ call setline(1, ['one', 'two', 'Line' .. (' with lots of text'->repeat(30))])
+ set smoothscroll scrolloff=0
+ normal 3G10|zt
+ ]])
+ -- scrolling up, cursor moves screen line down
+ screen:expect([[
+ Line with^ lots of text with lots of text|
+ with 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|
+ |
+ ]])
+ feed('<C-E>')
+ screen:expect([[
+ <<<th lot^s 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|
+ |
+ ]])
+ feed('5<C-E>')
+ screen:expect([[
+ <<< lots ^of text with lots of text with |
+ lots of text with lots of text with lots|
+ of text with lots of text with lots of |
+ text with lots of text with lots of text|
+ with lots of text with lots of text wit|
+ |
+ ]])
+ -- scrolling down, cursor moves screen line up
+ feed('5<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 with lots of text with lots of te|
+ xt with l^ots of text with lots of text w|
+ |
+ ]])
+ feed('<C-Y>')
+ screen:expect([[
+ Line with lots of text with lots of text|
+ with 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|
+ |
+ ]])
+ end)
end)