aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-05-19 18:42:54 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-05-19 19:28:01 +0200
commitcf0f83ebf0d74b11c1ffdc4d1066555f312a91ec (patch)
tree95b2d868504355e89385fb377b46527e8cf60087 /test/functional
parent02ef104d5bcd40c048e8011e0106f30389034674 (diff)
downloadrneovim-cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec.tar.gz
rneovim-cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec.tar.bz2
rneovim-cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec.zip
vim-patch:9.0.1568: with 'smoothscroll' cursor may move below botline
Problem: With 'smoothscroll' cursor may move below botline. Solution: Call redraw_later() if needed, Compute cursor row with adjusted condition. (Luuk van Baal, closes vim/vim#12415) https://github.com/vim/vim/commit/d49f646bf56b29d44bbb16e79bc877b59aab38ac
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua102
1 files changed, 68 insertions, 34 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 056262939b..cd4c2fda8b 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -422,42 +422,15 @@ describe('smoothscroll', function()
|
]])
feed('j')
- 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 |
- @ |
- |
- ]])
+ screen:expect_unchanged()
-- moving cursor down - whole bottom line shows
feed('<C-E>j')
- screen:expect([[
- <<<h 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 |
- ^Line with some text with some text with |
- some text with some text with some text |
- with some text with some text |
- |
- ]])
+ screen:expect_unchanged()
feed('G')
- -- FIXME: different from vim onwards, this had in incorrect cursor position
- -- in vim but we show an eob line.
- screen:expect([[
- <<<h 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 |
- Line with some text with some text with |
- some text with some text with some text |
- ^with some text with some text |
- |
- ]])
- -- moving cursor up right after the >>> marker - no need to show whole line
+ screen:expect_unchanged()
+ feed('4<C-Y>G')
+ screen:expect_unchanged()
+ -- moving cursor up right after the <<< marker - no need to show whole line
feed('2gj3l2k')
screen:expect([[
<<<^h some text with some text |
@@ -469,7 +442,7 @@ describe('smoothscroll', function()
with some text with some text |
|
]])
- -- moving cursor up where the >>> marker is - whole top line shows
+ -- moving cursor up where the <<< marker is - whole top line shows
feed('2j02k')
screen:expect([[
^Line with some text with some text with |
@@ -805,6 +778,67 @@ describe('smoothscroll', function()
]])
end)
+ -- oldtest: Test_smoothscroll_incsearch()
+ it("does not reset skipcol when doing incremental search on the same word", function()
+ screen:try_resize(40, 8)
+ screen:set_default_attr_ids({
+ [1] = {foreground = Screen.colors.Brown},
+ [2] = {foreground = Screen.colors.Blue1, bold = true},
+ [3] = {background = Screen.colors.Yellow1},
+ [4] = {reverse = true},
+ })
+ exec([[
+ set smoothscroll number scrolloff=0 incsearch
+ call setline(1, repeat([''], 20))
+ call setline(11, repeat('a', 100))
+ call setline(14, 'bbbb')
+ ]])
+ feed('/b')
+ screen:expect([[
+ {2:<<<}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {1: 12 } |
+ {1: 13 } |
+ {1: 14 }{4:b}{3:bbb} |
+ {1: 15 } |
+ {1: 16 } |
+ {1: 17 } |
+ /b^ |
+ ]])
+ feed('b')
+ screen:expect([[
+ {2:<<<}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {1: 12 } |
+ {1: 13 } |
+ {1: 14 }{4:bb}{3:bb} |
+ {1: 15 } |
+ {1: 16 } |
+ {1: 17 } |
+ /bb^ |
+ ]])
+ feed('b')
+ screen:expect([[
+ {2:<<<}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {1: 12 } |
+ {1: 13 } |
+ {1: 14 }{4:bbb}b |
+ {1: 15 } |
+ {1: 16 } |
+ {1: 17 } |
+ /bbb^ |
+ ]])
+ feed('b')
+ screen:expect([[
+ {2:<<<}{1: }aaaaaaaaaaaaaaaaaaaaaaaaaaaa |
+ {1: 12 } |
+ {1: 13 } |
+ {1: 14 }{4:bbbb} |
+ {1: 15 } |
+ {1: 16 } |
+ {1: 17 } |
+ /bbbb^ |
+ ]])
+ end)
+
it("works with virt_lines above and below", function()
screen:try_resize(55, 7)
exec([=[