From 0aa2c7e2ec2ee683a22fef68c229408708f7cd5d Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 26 Dec 2020 18:15:20 -0500 Subject: vim-patch:8.1.2227: layout wrong if 'lines' changes while cmdline window is open Problem: Layout wrong if 'lines' changes while cmdline window is open. Solution: Do not restore the window layout if 'lines' changed. (closes vim/vim#5130) https://github.com/vim/vim/commit/1c329c04be2e95a3589a53f2978926e91b450cca --- src/nvim/testdir/test_cmdline.vim | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim index 0c31619086..5b23525ab5 100644 --- a/src/nvim/testdir/test_cmdline.vim +++ b/src/nvim/testdir/test_cmdline.vim @@ -850,6 +850,36 @@ func Test_cmdwin_cedit() delfunc CmdWinType endfunc +func Test_cmdwin_restore() + CheckScreendump + + let lines =<< trim [SCRIPT] + call setline(1, range(30)) + 2split + [SCRIPT] + call writefile(lines, 'XTest_restore') + + let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12}) + call term_wait(buf, 100) + call term_sendkeys(buf, "q:") + call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {}) + + " normal restore + call term_sendkeys(buf, ":q\") + call VerifyScreenDump(buf, 'Test_cmdwin_restore_2', {}) + + " restore after setting 'lines' with one window + call term_sendkeys(buf, ":close\") + call term_sendkeys(buf, "q:") + call term_sendkeys(buf, ":set lines=18\") + call term_sendkeys(buf, ":q\") + call VerifyScreenDump(buf, 'Test_cmdwin_restore_3', {}) + + " clean up + call StopVimInTerminal(buf) + call delete('XTest_restore') +endfunc + func Test_buffers_lastused() " check that buffers are sorted by time when wildmode has lastused edit bufc " oldest -- cgit