neovim/test/old/testdir/test_cmdwin.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
903 B
VimL
Raw Normal View History

" 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
" vim: shiftwidth=2 sts=2 expandtab