From 669867a86f5a3b8a79ba07235d94bf13b591a4d1 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 6 Oct 2022 13:44:37 +0800 Subject: [PATCH] fixup! feat(window/ui): add splitkeep option vim-patch:9.0.0445: when opening/closing window text moves up/down Problem: When opening/closing window text moves up/down. Solution: Add the 'splitscroll' option. When off text will keep its position as much as possible. https://github.com/vim/vim/commit/29ab524358ba429bcf6811710afc97a978641f0b vim-patch:9.0.0455: a few problems with 'splitscroll' Problem: A few problems with 'splitscroll'. Solution: Fix 'splitscroll' problems. (Luuk van Baal, closes vim/vim#11117) https://github.com/vim/vim/commit/5ed391708a62b4ebaa84dd23e32a416e5c3383d9 vim-patch:9.0.0461: 'scroll' is not always updated Problem: 'scroll' is not always updated. Solution: Call win_init_size() at the right place. https://github.com/vim/vim/commit/470a14140bc06f1653edf26ab0b3c9b801080353 vim-patch:9.0.0465: cursor moves when cmdwin is closed when 'splitscroll' is off Problem: Cursor moves when cmdwin is closed when 'splitscroll' is off. Solution: Temporarily set 'splitscroll' when jumping back to the original window. (closes vim/vim#11128) https://github.com/vim/vim/commit/e697d488901b6321ddaad68b553f0a434c97d849 vim-patch:9.0.0469: cursor moves if cmdwin is closed when 'splitscroll' is off Problem: Cursor moves if cmdwin is closed when 'splitscroll' is off. Solution: Skip win_fix_cursor if called when cmdwin is open or closing. (Luuk van Baal, closes vim/vim#11134) https://github.com/vim/vim/commit/3735f11050616652525bf80b4fbcb2b3bfeab113 vim-patch:9.0.0478: test for 'splitscroll' takes too much time Problem: Test for 'splitscroll' takes too much time. Solution: Only test some of the combinations. (Luuk van Baal, closes vim/vim#11139) https://github.com/vim/vim/commit/594f9e09cd68e6277b8aa08094405bc642c5792a vim-patch:9.0.0486: text scrolled with 'nosplitscroll', autocmd win and help Problem: Text scrolled with 'nosplitscroll', autocmd win opened and help window closed. Solution: Skip win_fix_scroll() in more situations. (Luuk van Baal, closes vim/vim#11150) https://github.com/vim/vim/commit/d5bc762dea1fd32fa04342f8149f95ccfc3b9709 vim-patch:9.0.0505: various problems with 'nosplitscroll' Problem: Various problems with 'nosplitscroll'. Solution: Fix 'nosplitscroll' problems. (Luuk van Baal, closes vim/vim#11166) https://github.com/vim/vim/commit/faf1d412f5e3665021500b528c0e7301eb02bf0b vim-patch:9.0.0555: scrolling with 'nosplitscroll' in callback changing curwin Problem: Scrolling with 'nosplitscroll' in callback changing curwin. Solution: Invalidate w_cline_row in the right place. (Luuk van Baal, closes vim/vim#11185) https://github.com/vim/vim/commit/20e58561abc4116f3bfbafaef242d886dd77b303 vim-patch:9.0.0603: with 'nosplitscroll' folds are not handled correctly Problem: With 'nosplitscroll' folds are not handled correctly. Solution: Take care of closed folds when moving the cursor. (Luuk van Baal, closes vim/vim#11234) https://github.com/vim/vim/commit/7c1cbb6cd437c6e0c3ccc05840cc931108b4a60a vim-patch:9.0.0605: dump file missing Problem: Dump file missing. Solution: Add the missing dump file. (issue vim/vim#11234) https://github.com/vim/vim/commit/439a2ba1749463718b6ce1e1375b68c7b7cff808 vim-patch:9.0.0647: the 'splitscroll' option is not a good name Problem: The 'splitscroll' option is not a good name. Solution: Rename 'splitscroll' to 'splitkeep' and make it a string option, also supporting "topline". (Luuk van Baal, closes vim/vim#11258) https://github.com/vim/vim/commit/13ece2ae1d09009d3fb8acf858c288e7848ecdac vim-patch:9.0.0667: ml_get error when 'splitkeep' is "screen" Problem: ml_get error when 'splitkeep' is "screen". (Marius Gedminas) Solution: Check the botline is not too large. (Luuk van Baal, closes vim/vim#11293, closes vim/vim#11292) https://github.com/vim/vim/commit/346823d3e5668b99d2c2fd920e7f215e21ad3ea7 --- src/nvim/edit.c | 1 + src/nvim/globals.h | 7 +- src/nvim/option_defs.h | 2 +- src/nvim/optionstr.c | 2 +- src/nvim/testdir/test_window_cmd.vim | 30 ++-- src/nvim/window.c | 30 ++-- test/functional/legacy/window_cmd_spec.lua | 196 +++++++++++++++++++++ test/functional/ui/screen_basic_spec.lua | 188 -------------------- 8 files changed, 236 insertions(+), 220 deletions(-) create mode 100644 test/functional/legacy/window_cmd_spec.lua diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 43821e9d5fa025..09f20baebf9fea 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -2597,6 +2597,7 @@ int cursor_up(long n, int upd_topline) if (upd_topline) { update_topline(curwin); // make sure curwin->w_topline is valid } + return OK; } diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 1660b510139849..1a6c6392613224 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -1071,10 +1071,11 @@ EXTERN char windowsVersion[20] INIT(= { 0 }); EXTERN int exit_need_delay INIT(= 0); -// Skip win_fix_cursor() call for 'splitkeep' when cmdwin is closed. +///< Skip win_fix_cursor() call for 'splitkeep' when cmdwin is closed. EXTERN bool skip_win_fix_cursor INIT(= false); -// Skip win_fix_scroll() call for 'splitkeep' when closing tab page. +///< Skip win_fix_scroll() call for 'splitkeep' when closing tab page. EXTERN bool skip_win_fix_scroll INIT(= false); -// Skip update_topline() call while executing win_fix_scroll(). +///< Skip update_topline() call while executing win_fix_scroll(). EXTERN bool skip_update_topline INIT(= false); + #endif // NVIM_GLOBALS_H diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 81e658c975a33e..25ef1fc091bbff 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -729,7 +729,7 @@ EXTERN unsigned int tpf_flags; ///< flags from 'termpastefilter' EXTERN char *p_tfu; ///< 'tagfunc' EXTERN char *p_spc; ///< 'spellcapcheck' EXTERN char *p_spf; ///< 'spellfile' -EXTERN char *p_spk; // 'splitkeep' +EXTERN char *p_spk; ///< 'splitkeep' EXTERN char *p_spl; ///< 'spelllang' EXTERN char *p_spo; // 'spelloptions' EXTERN unsigned int spo_flags; diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index a4bf4f6a001583..1da6fa15d7e702 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -1097,7 +1097,7 @@ char *did_set_string_option(int opt_idx, char **varp, char *oldval, char *errbuf errmsg = e_invarg; } } else if (varp == &p_spk) { // 'splitkeep' - if (check_opt_strings(p_spk, p_spk_values, true) != OK) { + if (check_opt_strings(p_spk, p_spk_values, false) != OK) { errmsg = e_invarg; } } else if (varp == &p_debug) { // 'debug' diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim index a064f51591f93c..c4ce4d638cdf8d 100644 --- a/src/nvim/testdir/test_window_cmd.vim +++ b/src/nvim/testdir/test_window_cmd.vim @@ -1,5 +1,7 @@ " Tests for window cmd (:wincmd, :split, :vsplit, :resize and etc...) + source check.vim +source screendump.vim func Test_window_cmd_ls0_with_split() set ls=0 @@ -1504,7 +1506,9 @@ func Test_splitkeep_options() let &laststatus = (run % 3) let &splitbelow = (run % 3) let &equalalways = (run % 2) - "let wsb = (run % 2) && &splitbelow + " Nvim: both windows have a winbar after splitting + " let wsb = (run % 2) && &splitbelow + let wsb = 0 let tl = (gui ? 0 : ((run % 5) ? 1 : 0)) let pos = !(run % 3) ? 'H' : ((run % 2) ? 'M' : 'L') tabnew | tabonly! | redraw @@ -1526,17 +1530,17 @@ func Test_splitkeep_options() call assert_equal(1, line("w0")) call assert_equal(&scroll, winheight(0) / 2) wincmd j - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) " No scroll when resizing windows wincmd k | resize +2 | redraw call assert_equal(1, line("w0")) wincmd j - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) " No scroll when dragging statusline call win_move_statusline(1, -3) - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) wincmd k call assert_equal(1, line("w0")) @@ -1544,9 +1548,9 @@ func Test_splitkeep_options() set lines+=2 call assert_equal(1, line("w0")) wincmd j - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) set lines-=2 - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) wincmd k call assert_equal(1, line("w0")) @@ -1554,23 +1558,23 @@ func Test_splitkeep_options() wincmd = call assert_equal(1, line("w0")) wincmd j - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) wincmd k call assert_equal(1, line("w0")) " No scroll in windows split multiple times vsplit | split | 4wincmd w - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) 1wincmd w | quit | wincmd l | split - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) wincmd j - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) " No scroll in small window 2wincmd w | only | 5split | wincmd k call assert_equal(1, line("w0")) wincmd j - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) " No scroll for vertical split quit | vsplit | wincmd l @@ -1580,7 +1584,7 @@ func Test_splitkeep_options() " No scroll in windows split and quit multiple times quit | redraw | split | split | quit | redraw - call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 1 : win_screenpos(0)[0] - tl - wsb, line("w0")) " No scroll for new buffer 1wincmd w | only | copen | wincmd k @@ -1605,7 +1609,7 @@ func Test_splitkeep_options() only | execute "norm gg5\" | split | wincmd k call assert_equal(6, line("w0")) wincmd j - call assert_equal(&spk == 'topline' ? 6 : 5 + win_screenpos(0)[0] - tl, line("w0")) + call assert_equal(&spk == 'topline' ? 6 : 5 + win_screenpos(0)[0] - tl - wsb, line("w0")) endfor tabnew | tabonly! | %bwipeout! diff --git a/src/nvim/window.c b/src/nvim/window.c index b6fd3408e01350..ecd713013f6166 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -6081,12 +6081,12 @@ void set_fraction(win_T *wp) } } -// Handle scroll position for 'splitkeep'. Replaces scroll_to_fraction() -// call from win_set_inner_size(). Instead we iterate over all windows in a -// tabpage and calculate the new scroll position. -// TODO(luukvbaal): Ensure this also works with wrapped lines. -// Requires topline to be able to be set to a bufferline with some -// offset(row-wise scrolling/smoothscroll). +/// Handle scroll position for 'splitkeep'. Replaces scroll_to_fraction() +/// call from win_set_inner_size(). Instead we iterate over all windows in a +/// tabpage and calculate the new scroll position. +/// TODO(luukvbaal): Ensure this also works with wrapped lines. +/// Requires topline to be able to be set to a bufferline with some +/// offset(row-wise scrolling/smoothscroll). void win_fix_scroll(int resize) { linenr_T lnum; @@ -6095,14 +6095,14 @@ void win_fix_scroll(int resize) FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { // Skip when window height has not changed or when floating. if (!wp->w_floating && wp->w_height != wp->w_prev_height) { - // Determine botline needed to avoid scrolling and set cursor. + // If window has moved update botline to keep the same screenlines. if (*p_spk == 's' && wp->w_winrow != wp->w_prev_winrow && wp->w_botline - 1 <= wp->w_buffer->b_ml.ml_line_count) { + lnum = wp->w_cursor.lnum; int diff = (wp->w_winrow - wp->w_prev_winrow) + (wp->w_height - wp->w_prev_height); - lnum = wp->w_cursor.lnum; wp->w_cursor.lnum = wp->w_botline - 1; - // Add difference in height and row to botline. + // Add difference in height and row to botline. if (diff > 0) { cursor_down_inner(wp, diff); } else { @@ -6131,9 +6131,9 @@ void win_fix_scroll(int resize) } } -// Make sure the cursor position is valid for 'splitkeep'. -// If it is not, put the cursor position in the jumplist and move it. -// If we are not in normal mode, scroll to make valid instead. +/// Make sure the cursor position is valid for 'splitkeep'. +/// If it is not, put the cursor position in the jumplist and move it. +/// If we are not in normal mode, scroll to make valid instead. static void win_fix_cursor(int normal) { win_T *wp = curwin; @@ -6146,6 +6146,7 @@ static void win_fix_cursor(int normal) return; } + // Determine valid cursor range. so = MIN(wp->w_height_inner / 2, so); wp->w_cursor.lnum = wp->w_topline; linenr_T top = cursor_down_inner(wp, so); @@ -6160,7 +6161,8 @@ static void win_fix_cursor(int normal) } if (nlnum) { // Cursor is invalid for current scroll position. - if (normal) { // Save to jumplist and set cursor to avoid scrolling. + if (normal) { + // Save to jumplist and set cursor to avoid scrolling. setmark('\''); wp->w_cursor.lnum = nlnum; } else { @@ -6327,7 +6329,7 @@ void win_set_inner_size(win_T *wp, bool valid_cursor) // There is no point in adjusting the scroll position when exiting. Some // values might be invalid. - if (!exiting && valid_cursor && *p_spk == 'c') { + if (valid_cursor && !exiting && *p_spk == 'c') { scroll_to_fraction(wp, prev_height); } redraw_later(wp, UPD_SOME_VALID); diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua new file mode 100644 index 00000000000000..8b89c55f5b32f0 --- /dev/null +++ b/test/functional/legacy/window_cmd_spec.lua @@ -0,0 +1,196 @@ +local helpers = require('test.functional.helpers')(after_each) +local Screen = require('test.functional.ui.screen') +local clear = helpers.clear +local exec = helpers.exec +local exec_lua = helpers.exec_lua +local feed = helpers.feed + +describe('splitkeep', function() + local screen = Screen.new() + before_each(function() + clear('--cmd', 'set splitkeep=screen') + screen:attach() + end) + + -- oldtest: Test_splitkeep_callback() + it('does not scroll when split in callback', function() + exec([[ + call setline(1, range(&lines)) + function C1(a, b, c) + split | wincmd p + endfunction + function C2(a, b, c) + close | split + endfunction + ]]) + exec_lua([[ + vim.api.nvim_set_keymap("n", "j", "", { callback = function() + vim.cmd("call jobstart([&sh, &shcf, 'true'], { 'on_exit': 'C1' })") + end + })]]) + exec_lua([[ + vim.api.nvim_set_keymap("n", "t", "", { callback = function() + vim.api.nvim_set_current_win( + vim.api.nvim_open_win(vim.api.nvim_create_buf(false, {}), false, { + width = 10, + relative = "cursor", + height = 4, + row = 0, + col = 0, + })) + vim.cmd("call termopen([&sh, &shcf, 'true'], { 'on_exit': 'C2' })") + end + })]]) + feed('j') + screen:expect([[ + 0 | + 1 | + 2 | + 3 | + 4 | + 5 | + [No Name] [+] | + ^7 | + 8 | + 9 | + 10 | + 11 | + [No Name] [+] | + | + ]]) + feed(':quitHt') + screen:expect([[ + ^0 | + 1 | + 2 | + 3 | + 4 | + 5 | + [No Name] [+] | + 7 | + 8 | + 9 | + 10 | + 11 | + [No Name] [+] | + :quit | + ]]) + feed(':set sb:quitGj') + screen:expect([[ + 1 | + 2 | + 3 | + 4 | + ^5 | + [No Name] [+] | + 7 | + 8 | + 9 | + 10 | + 11 | + 12 | + [No Name] [+] | + :quit | + ]]) + feed(':quitGt') + screen:expect([[ + 1 | + 2 | + 3 | + 4 | + 5 | + [No Name] [+] | + 7 | + 8 | + 9 | + 10 | + 11 | + ^12 | + [No Name] [+] | + :quit | + ]]) + end) + + -- oldtest: Test_splitkeep_fold() + it('does not scroll when window has closed folds', function() + exec([[ + set splitkeep=screen + set foldmethod=marker + set number + let line = 1 + for n in range(1, &lines) + call setline(line, ['int FuncName() {/*{{{*/', 1, 2, 3, 4, 5, '}/*}}}*/', + \ 'after fold']) + let line += 8 + endfor + ]]) + feed('L:wincmd s') + screen:expect([[ + 1 +-- 7 lines: int FuncName() {···················| + 8 after fold | + 9 +-- 7 lines: int FuncName() {···················| + 16 after fold | + 17 +-- 7 lines: int FuncName() {···················| + 24 ^after fold | + [No Name] [+] | + 32 after fold | + 33 +-- 7 lines: int FuncName() {···················| + 40 after fold | + 41 +-- 7 lines: int FuncName() {···················| + 48 after fold | + [No Name] [+] | + :wincmd s | + ]]) + feed(':quit') + screen:expect([[ + 1 +-- 7 lines: int FuncName() {···················| + 8 after fold | + 9 +-- 7 lines: int FuncName() {···················| + 16 after fold | + 17 +-- 7 lines: int FuncName() {···················| + 24 after fold | + 25 +-- 7 lines: int FuncName() {···················| + 32 after fold | + 33 +-- 7 lines: int FuncName() {···················| + 40 after fold | + 41 +-- 7 lines: int FuncName() {···················| + 48 after fold | + 49 ^+-- 7 lines: int FuncName() {···················| + :quit | + ]]) + feed('H:below split') + screen:expect([[ + 1 +-- 7 lines: int FuncName() {···················| + 8 after fold | + 9 +-- 7 lines: int FuncName() {···················| + 16 after fold | + 17 +-- 7 lines: int FuncName() {···················| + [No Name] [+] | + 25 ^+-- 7 lines: int FuncName() {···················| + 32 after fold | + 33 +-- 7 lines: int FuncName() {···················| + 40 after fold | + 41 +-- 7 lines: int FuncName() {···················| + 48 after fold | + [No Name] [+] | + :below split | + ]]) + feed(':wincmd k:quit') + screen:expect([[ + 1 +-- 7 lines: int FuncName() {···················| + 8 after fold | + 9 +-- 7 lines: int FuncName() {···················| + 16 after fold | + 17 +-- 7 lines: int FuncName() {···················| + 24 after fold | + 25 ^+-- 7 lines: int FuncName() {···················| + 32 after fold | + 33 +-- 7 lines: int FuncName() {···················| + 40 after fold | + 41 +-- 7 lines: int FuncName() {···················| + 48 after fold | + 49 +-- 7 lines: int FuncName() {···················| + :quit | + ]]) + end) +end) diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua index 9998e9ee21f898..58c8238c358948 100644 --- a/test/functional/ui/screen_basic_spec.lua +++ b/test/functional/ui/screen_basic_spec.lua @@ -1027,191 +1027,3 @@ describe('Screen default colors', function() end} end) end) - -describe('splitkeep', function() - local screen = Screen.new() - before_each(function() - clear('--cmd', 'set splitkeep=screen') - screen:attach() - end) - - -- oldtest: Test_splitkeep_callback() - it('does not scroll when split in callback', function() - command([[ - call setline(1, range(&lines)) - function C1(a, b, c) - split | wincmd p - endfunction - function C2(a, b, c) - close | split - endfunction - ]]) - exec_lua([[ - vim.api.nvim_set_keymap("n", "j", "", { callback = function() - vim.cmd("call jobstart([&sh, &shcf, 'true'], { 'on_exit': 'C1' })") - end - })]]) - exec_lua([[ - vim.api.nvim_set_keymap("n", "t", "", { callback = function() - vim.api.nvim_set_current_win( - vim.api.nvim_open_win(vim.api.nvim_create_buf(false, {}), false, { - width = 10, - relative = "cursor", - height = 4, - row = 0, - col = 0, - })) - vim.cmd("call termopen([&sh, &shcf, 'true'], { 'on_exit': 'C2' })") - end - })]]) - feed('j') - screen:expect([[ - 0 | - 1 | - 2 | - 3 | - 4 | - 5 | - [No Name] [+] | - ^7 | - 8 | - 9 | - 10 | - 11 | - [No Name] [+] | - | - ]]) - feed(':quitHt') - screen:expect([[ - ^0 | - 1 | - 2 | - 3 | - 4 | - 5 | - [No Name] [+] | - 7 | - 8 | - 9 | - 10 | - 11 | - [No Name] [+] | - :quit | - ]]) - feed(':set sb:quitGj') - screen:expect([[ - 1 | - 2 | - 3 | - 4 | - ^5 | - [No Name] [+] | - 7 | - 8 | - 9 | - 10 | - 11 | - 12 | - [No Name] [+] | - :quit | - ]]) - feed(':quitGt') - screen:expect([[ - 1 | - 2 | - 3 | - 4 | - 5 | - [No Name] [+] | - 7 | - 8 | - 9 | - 10 | - 11 | - ^12 | - [No Name] [+] | - :quit | - ]]) - end) - - -- oldtest: Test_splitkeep_fold() - it('does not scroll when window has closed folds', function() - command([[ - set foldmethod=marker - set number - let line = 1 - for n in range(1, &lines) - call setline(line, ['int FuncName() {/*{{{*/', 1, 2, 3, 4, 5, '}/*}}}*/', 'after fold']) - let line += 8 - endfor - ]]) - feed('L:wincmd s') - screen:expect([[ - 1 +-- 7 lines: int FuncName() {···················| - 8 after fold | - 9 +-- 7 lines: int FuncName() {···················| - 16 after fold | - 17 +-- 7 lines: int FuncName() {···················| - 24 ^after fold | - [No Name] [+] | - 32 after fold | - 33 +-- 7 lines: int FuncName() {···················| - 40 after fold | - 41 +-- 7 lines: int FuncName() {···················| - 48 after fold | - [No Name] [+] | - :wincmd s | - ]]) - feed(':quit') - screen:expect([[ - 1 +-- 7 lines: int FuncName() {···················| - 8 after fold | - 9 +-- 7 lines: int FuncName() {···················| - 16 after fold | - 17 +-- 7 lines: int FuncName() {···················| - 24 after fold | - 25 +-- 7 lines: int FuncName() {···················| - 32 after fold | - 33 +-- 7 lines: int FuncName() {···················| - 40 after fold | - 41 +-- 7 lines: int FuncName() {···················| - 48 after fold | - 49 ^+-- 7 lines: int FuncName() {···················| - :quit | - ]]) - feed('H:below split') - screen:expect([[ - 1 +-- 7 lines: int FuncName() {···················| - 8 after fold | - 9 +-- 7 lines: int FuncName() {···················| - 16 after fold | - 17 +-- 7 lines: int FuncName() {···················| - [No Name] [+] | - 25 ^+-- 7 lines: int FuncName() {···················| - 32 after fold | - 33 +-- 7 lines: int FuncName() {···················| - 40 after fold | - 41 +-- 7 lines: int FuncName() {···················| - 48 after fold | - [No Name] [+] | - :below split | - ]]) - feed(':wincmd k:quit') - screen:expect([[ - 1 +-- 7 lines: int FuncName() {···················| - 8 after fold | - 9 +-- 7 lines: int FuncName() {···················| - 16 after fold | - 17 +-- 7 lines: int FuncName() {···················| - 24 after fold | - 25 ^+-- 7 lines: int FuncName() {···················| - 32 after fold | - 33 +-- 7 lines: int FuncName() {···················| - 40 after fold | - 41 +-- 7 lines: int FuncName() {···················| - 48 after fold | - 49 +-- 7 lines: int FuncName() {···················| - :quit | - ]]) - end) -end)