aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-13 23:08:01 +0800
committerGitHub <noreply@github.com>2023-05-13 23:08:01 +0800
commit79d5f06f79ca2f84a89be3fe2b3d498a72e37a55 (patch)
treee960618fe3e508a432ee9b814a387f8bf8c22024 /test
parent6f29c68928c3f20d9a1b1a7a311cfac65aa1b4e6 (diff)
parentcd9ca700e5053f8a9666c917310dcc39651e3bfa (diff)
downloadrneovim-79d5f06f79ca2f84a89be3fe2b3d498a72e37a55.tar.gz
rneovim-79d5f06f79ca2f84a89be3fe2b3d498a72e37a55.tar.bz2
rneovim-79d5f06f79ca2f84a89be3fe2b3d498a72e37a55.zip
Merge pull request #23612 from zeertzjq/vim-9.0.0064
vim-patch:9.0.{0064,0218,0249,0490,0492,0598}: cmdwin fixes
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_cmdwin.vim67
1 files changed, 67 insertions, 0 deletions
diff --git a/test/old/testdir/test_cmdwin.vim b/test/old/testdir/test_cmdwin.vim
new file mode 100644
index 0000000000..f948d46be1
--- /dev/null
+++ b/test/old/testdir/test_cmdwin.vim
@@ -0,0 +1,67 @@
+" Tests for editing the command line.
+
+source check.vim
+source screendump.vim
+
+
+func Test_cant_open_cmdwin_in_cmdwin()
+ try
+ call feedkeys("q:q::q\<CR>", "x!")
+ catch
+ let caught = v:exception
+ endtry
+ call assert_match('E1292:', caught)
+endfunc
+
+func Test_cmdwin_virtual_edit()
+ enew!
+ set ve=all cpo+=$
+ silent normal q/s
+
+ set ve= cpo-=$
+endfunc
+
+" Check that a :normal command can be used to stop Visual mode without side
+" effects.
+func Test_normal_escape()
+ call feedkeys("q:i\" foo\<Esc>:normal! \<C-V>\<Esc>\<CR>:\" bar\<CR>", 'ntx')
+ call assert_equal('" bar', @:)
+endfunc
+
+" This was using a pointer to a freed buffer
+func Test_cmdwin_freed_buffer_ptr()
+ " this does not work on MS-Windows because renaming an open file fails
+ CheckNotMSWindows
+
+ au BufEnter * next 0| file
+ edit 0
+ silent! norm q/
+
+ au! BufEnter
+ bwipe!
+endfunc
+
+" This was resulting in a window with negative width.
+" The test doesn't reproduce the illegal memory access though...
+func Test_cmdwin_split_often()
+ let lines = &lines
+ let columns = &columns
+ set t_WS=
+
+ try
+ " set encoding=iso8859
+ set ruler
+ winsize 0 0
+ noremap 0 H
+ sil norm 0000000q:
+ catch /E36:/
+ endtry
+
+ bwipe!
+ set encoding=utf8
+ let &lines = lines
+ let &columns = columns
+endfunc
+
+
+" vim: shiftwidth=2 sts=2 expandtab