diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /test/functional/legacy/window_cmd_spec.lua | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/legacy/window_cmd_spec.lua')
-rw-r--r-- | test/functional/legacy/window_cmd_spec.lua | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua index 0e9775060d..979b46ae47 100644 --- a/test/functional/legacy/window_cmd_spec.lua +++ b/test/functional/legacy/window_cmd_spec.lua @@ -3,8 +3,37 @@ local Screen = require('test.functional.ui.screen') local clear = helpers.clear local exec = helpers.exec local exec_lua = helpers.exec_lua +local command = helpers.command local feed = helpers.feed +-- oldtest: Test_window_cmd_ls0_split_scrolling() +it('scrolling with laststatus=0 and :botright split', function() + clear('--cmd', 'set ruler') + local screen = Screen.new(40, 10) + screen:set_default_attr_ids({ + [1] = {reverse = true}, -- StatusLineNC + }) + screen:attach() + exec([[ + set laststatus=0 + call setline(1, range(1, 100)) + normal! G + ]]) + command('botright split') + screen:expect([[ + 97 | + 98 | + 99 | + 100 | + {1:[No Name] [+] 100,1 Bot}| + 97 | + 98 | + 99 | + ^100 | + 100,1 Bot | + ]]) +end) + describe('splitkeep', function() local screen @@ -14,6 +43,61 @@ describe('splitkeep', function() screen:attach() end) + -- oldtest: Test_splitkeep_cursor() + it('does not adjust cursor in window that did not change size', function() + screen:try_resize(75, 8) + -- FIXME: bottom window is different without the "vsplit | close" + exec([[ + vsplit | close + set scrolloff=5 + set splitkeep=screen + autocmd CursorMoved * wincmd p | wincmd p + call setline(1, range(1, 200)) + func CursorEqualize() + call cursor(100, 1) + wincmd = + endfunc + wincmd s + call CursorEqualize() + ]]) + + screen:expect([[ + 99 | + ^100 | + 101 | + [No Name] [+] | + 5 | + 6 | + [No Name] [+] | + | + ]]) + + feed('j') + screen:expect([[ + 100 | + ^101 | + 102 | + [No Name] [+] | + 5 | + 6 | + [No Name] [+] | + | + ]]) + + command('set scrolloff=0') + feed('G') + screen:expect([[ + 198 | + 199 | + ^200 | + [No Name] [+] | + 5 | + 6 | + [No Name] [+] | + | + ]]) + end) + -- oldtest: Test_splitkeep_callback() it('does not scroll when split in callback', function() exec([[ @@ -116,6 +200,7 @@ describe('splitkeep', function() -- oldtest: Test_splitkeep_fold() it('does not scroll when window has closed folds', function() exec([[ + set commentstring=/*%s*/ set splitkeep=screen set foldmethod=marker set number @@ -224,4 +309,29 @@ describe('splitkeep', function() | ]]) end) + + -- oldtest: Test_splitkeep_skipcol() + it('skipcol is not reset unnecessarily and is copied to new window', function() + screen:try_resize(40, 12) + exec([[ + set splitkeep=topline smoothscroll splitbelow scrolloff=0 + call setline(1, 'with lots of text in one line '->repeat(6)) + norm 2 + wincmd s + ]]) + screen:expect([[ + <<<e line with lots of text in one line | + with lots of text in one line with lots | + of text in one line | + ~ | + [No Name] [+] | + <<<e line with lots of text in one line | + ^with lots of text in one line with lots | + of text in one line | + ~ | + ~ | + [No Name] [+] | + | + ]]) + end) end) |