aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/scroll_opt_spec.lua
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-04-26 17:23:42 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-05-02 13:11:46 +0200
commitd95697d6d4533e84bbb9d262b355ee9f71bd7452 (patch)
tree26ab574d0d01d7609a6f0533faa6add8168d2afb /test/functional/legacy/scroll_opt_spec.lua
parent3a1973debceca29e65c4f7c83d025cb3314ebaf2 (diff)
downloadrneovim-d95697d6d4533e84bbb9d262b355ee9f71bd7452.tar.gz
rneovim-d95697d6d4533e84bbb9d262b355ee9f71bd7452.tar.bz2
rneovim-d95697d6d4533e84bbb9d262b355ee9f71bd7452.zip
vim-patch:9.0.0673: first line wong with 'smoothscroll' and 'scrolloff' zero
Problem: First line not scrolled properly with 'smoothscroll' and 'scrolloff' zero and using "k". Solution: Make sure the cursor position is visible. https://github.com/vim/vim/commit/46b54747c5d252c584571a321231bad9330018ec 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.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index c63401cb02..fb4990ff00 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -307,7 +307,7 @@ describe('smoothscroll', function()
screen:try_resize(40, 8)
exec([[
call setline(1, ['Line' .. (' with some text'->repeat(7))]->repeat(7))
- set smoothscroll scrolloff=0
+ set smoothscroll scrolloff=0 display=
:3
]])
screen:expect([[
@@ -322,9 +322,22 @@ describe('smoothscroll', function()
]])
feed('j')
screen:expect_unchanged()
+ -- moving cursor down - whole bottom line shows
feed('<C-E>j')
screen:expect_unchanged()
feed('G')
screen:expect_unchanged()
+ -- moving cursor up - whole top line shows
+ feed('2k')
+ screen:expect([[
+ ^Line with some text with some text with |
+ some text with some text with some text |
+ with some text with some text |
+ Line with some text with some text with |
+ some text with some text with some text |
+ with some text with some text |
+ @ |
+ |
+ ]])
end)
end)