2023-05-13 07:23:02 -07:00
|
|
|
|
" 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
|
|
|
|
|
|
2023-05-13 07:26:53 -07:00
|
|
|
|
func Test_cmdwin_virtual_edit()
|
|
|
|
|
enew!
|
|
|
|
|
set ve=all cpo+=$
|
|
|
|
|
silent normal q/s
|
|
|
|
|
|
|
|
|
|
set ve= cpo-=$
|
|
|
|
|
endfunc
|
|
|
|
|
|
2023-05-13 07:28:34 -07:00
|
|
|
|
" 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
|
|
|
|
|
|
2023-05-13 07:29:07 -07:00
|
|
|
|
" This was using a pointer to a freed buffer
|
|
|
|
|
func Test_cmdwin_freed_buffer_ptr()
|
2023-05-13 07:38:54 -07:00
|
|
|
|
" this does not work on MS-Windows because renaming an open file fails
|
|
|
|
|
CheckNotMSWindows
|
|
|
|
|
|
2023-05-13 07:29:07 -07:00
|
|
|
|
au BufEnter * next 0| file
|
|
|
|
|
edit 0
|
|
|
|
|
silent! norm q/
|
|
|
|
|
|
|
|
|
|
au! BufEnter
|
|
|
|
|
bwipe!
|
|
|
|
|
endfunc
|
|
|
|
|
|
2023-05-13 07:39:28 -07:00
|
|
|
|
" 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
|
|
|
|
|
|
2023-05-13 07:23:02 -07:00
|
|
|
|
|
|
|
|
|
" vim: shiftwidth=2 sts=2 expandtab
|