aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-18 06:13:46 +0800
committerGitHub <noreply@github.com>2024-05-18 06:13:46 +0800
commit5f9e7edae6b8d56dd44b41dee02b8e9411572b58 (patch)
treeb1a9c756bfe8999cf429f3d07d3d03cce67056b4 /test
parent512d228111bccf3e52613c798edc7f803c1de13f (diff)
parentf178b8ba4963345879c3a1291ab81805d17c2e0e (diff)
downloadrneovim-5f9e7edae6b8d56dd44b41dee02b8e9411572b58.tar.gz
rneovim-5f9e7edae6b8d56dd44b41dee02b8e9411572b58.tar.bz2
rneovim-5f9e7edae6b8d56dd44b41dee02b8e9411572b58.zip
Merge pull request #28790 from luukvbaal/vim-9.1.0414
vim-patch:9.1.{0414,0416}
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua87
-rw-r--r--test/old/testdir/test_scroll_opt.vim35
2 files changed, 122 insertions, 0 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 06460a9986..97578067d5 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -1197,4 +1197,91 @@ describe('smoothscroll', function()
|
]])
end)
+
+ it('works with very long line and scrolloff', function()
+ screen:try_resize(40, 8)
+ exec([[
+ set smoothscroll scrolloff=3
+ call setline(1, ['one', 'two long '->repeat(100), 'three', 'four', 'five', 'six'])
+ ]])
+ --FIXME: incorrect screen due to reset_skipcol()/curs_columns() shenanigans
+ feed(':norm j721|<CR>')
+ screen:expect([[
+ two long two long two long two long two |
+ long two long two long two long two long|
+ two long two long two long two long two|
+ ^ long two long two long two long two lon|
+ g two long two long two long two long tw|
+ o long two long two long two long two lo|
+ ng two long two long two long two long t|
+ :norm j721| |
+ ]])
+ feed('gj')
+ screen:expect([[
+ {1:<<<}two long two long two long two long t|
+ wo long two long two long two long two l|
+ ong two long two long two long two long |
+ two long two long two long two long two |
+ ^long two long two long two long two long|
+ two long two long two long two long two|
+ long two long two long two long two lon|
+ :norm j721| |
+ ]])
+ feed('gj')
+ screen:expect([[
+ {1:<<<}long two long two long two long two l|
+ ong two long two long two long two long |
+ two long two long two long two long two |
+ long two long two long two long two long|
+ ^ two long two long two long two long two|
+ long two long two long two long two lon|
+ g two long two long |
+ :norm j721| |
+ ]])
+ feed('gj')
+ screen:expect([[
+ {1:<<<}long two long two long two long two l|
+ ong two long two long two long two long |
+ two long two long two long two long two |
+ long two long two long two long two long|
+ two long two long two long two long two|
+ ^ long two long two long two long two lon|
+ g two long two long |
+ :norm j721| |
+ ]])
+ feed('gj')
+ screen:expect([[
+ {1:<<<}long two long two long two long two l|
+ ong two long two long two long two long |
+ two long two long two long two long two |
+ long two long two long two long two long|
+ two long two long two long two long two|
+ long two long two long two long two lon|
+ ^g two long two long |
+ :norm j721| |
+ ]])
+ feed('gj')
+ screen:expect([[
+ {1:<<<} long two long two long two long two |
+ long two long two long two long two long|
+ two long two long two long two long two|
+ long two long two long two long two lon|
+ g two long two long |
+ ^three |
+ four |
+ :norm j721| |
+ ]])
+ feed('gk')
+ --FIXME: incorrect screen due to reset_skipcol()/curs_columns() shenanigans
+ screen:expect([[
+ two long two long two long two long two |
+ long two long two long two long two long|
+ two long two long two long two long two|
+ long two long two long two long two lon|
+ g two long two long two long two long tw|
+ o long two long two long two long two lo|
+ ^ng two long two long two long two long t|
+ :norm j721| |
+ ]])
+ end)
end)
diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim
index c7b986e040..76b4089bd1 100644
--- a/test/old/testdir/test_scroll_opt.vim
+++ b/test/old/testdir/test_scroll_opt.vim
@@ -1156,4 +1156,39 @@ func Test_smoothscroll_long_line_zb()
bwipe!
endfunc
+func Test_smooth_long_scrolloff()
+ CheckScreendump
+
+ let lines =<< trim END
+ set smoothscroll scrolloff=3
+ call setline(1, ['one', 'two long '->repeat(100), 'three', 'four', 'five', 'six'])
+ END
+ call writefile(lines, 'XSmoothLongScrolloff', 'D')
+ let buf = RunVimInTerminal('-u NONE -S XSmoothLongScrolloff', #{rows: 8, cols: 40})
+ "FIXME: empty screen due to reset_skipcol()/curs_columns() shenanigans
+ call term_sendkeys(buf, ":norm j721|\<CR>")
+ call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_1', {})
+
+ call term_sendkeys(buf, "gj")
+ call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_2', {})
+
+ call term_sendkeys(buf, "gj")
+ call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_3', {})
+
+ call term_sendkeys(buf, "gj")
+ call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_4', {})
+
+ call term_sendkeys(buf, "gj")
+ call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_5', {})
+
+ call term_sendkeys(buf, "gj")
+ call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_6', {})
+
+ call term_sendkeys(buf, "gk")
+ "FIXME: empty screen due to reset_skipcol()/curs_columns() shenanigans
+ call VerifyScreenDump(buf, 'Test_smooth_long_scrolloff_7', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab