diff options
Diffstat (limited to 'src/nvim/testdir/test_ex_mode.vim')
-rw-r--r-- | src/nvim/testdir/test_ex_mode.vim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_ex_mode.vim b/src/nvim/testdir/test_ex_mode.vim index 87c23a2fe8..f70cb261e0 100644 --- a/src/nvim/testdir/test_ex_mode.vim +++ b/src/nvim/testdir/test_ex_mode.vim @@ -54,3 +54,29 @@ func Test_ex_mode() set sw& let &encoding = encoding_save endfunc + +func Test_ex_mode_errors() + " Not allowed to enter ex mode when text is locked + au InsertCharPre <buffer> normal! gQ<CR> + let caught_e523 = 0 + try + call feedkeys("ix\<esc>", 'xt') + catch /^Vim\%((\a\+)\)\=:E523/ " catch E523 + let caught_e523 = 1 + endtry + call assert_equal(1, caught_e523) + au! InsertCharPre + + new + au CmdLineEnter * call ExEnterFunc() + func ExEnterFunc() + + endfunc + call feedkeys("gQvi\r", 'xt') + + au! CmdLineEnter + delfunc ExEnterFunc + quit +endfunc + +" vim: shiftwidth=2 sts=2 expandtab |