summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cmdline.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-10-27 20:37:35 +0100
committerBram Moolenaar <Bram@vim.org>2019-10-27 20:37:35 +0100
commit1c329c04be2e95a3589a53f2978926e91b450cca (patch)
tree339efc67b38eb018df704b57e1d83690ace16e32 /src/testdir/test_cmdline.vim
parent5b418992cf254137fde2a14d7066fbea5afddb28 (diff)
patch 8.1.2227: layout wrong if 'lines' changes while cmdline window is openv8.1.2227
Problem: Layout wrong if 'lines' changes while cmdline window is open. Solution: Do not restore the window layout if 'lines' changed. (closes #5130)
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r--src/testdir/test_cmdline.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index 57dff41673..3f73d3da34 100644
--- 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