Mercurial > vim
diff src/testdir/test_cmdline.vim @ 18467:99fc29219b3e v8.1.2227
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is open
Commit: https://github.com/vim/vim/commit/1c329c04be2e95a3589a53f2978926e91b450cca
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 27 20:37:35 2019 +0100
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 #5130)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 27 Oct 2019 20:45:03 +0100 |
parents | 18d7337b6837 |
children | baf890fa1621 |
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -768,6 +768,36 @@ func Test_cmdwin_bug() bw! 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\<CR>") + call VerifyScreenDump(buf, 'Test_cmdwin_restore_2', {}) + + " restore after setting 'lines' with one window + call term_sendkeys(buf, ":close\<CR>") + call term_sendkeys(buf, "q:") + call term_sendkeys(buf, ":set lines=18\<CR>") + call term_sendkeys(buf, ":q\<CR>") + 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 call test_settime(1550020000) " middle