diff src/testdir/test_edit.vim @ 19613:9c15be376631 v8.2.0363

patch 8.2.0363: some Normal mode commands not tested Commit: https://github.com/vim/vim/commit/f5f1e10d0d39890298cdf27f664d466c8872b87e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 8 05:13:15 2020 +0100 patch 8.2.0363: some Normal mode commands not tested Problem: Some Normal mode commands not tested. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5746)
author Bram Moolenaar <Bram@vim.org>
date Sun, 08 Mar 2020 05:15:04 +0100
parents 67fbe280a502
children f70a3c1000bb
line wrap: on
line diff
--- a/src/testdir/test_edit.vim
+++ b/src/testdir/test_edit.vim
@@ -265,6 +265,10 @@ func Test_edit_10()
   call cursor(1, 4)
   call feedkeys("A\<s-home>start\<esc>", 'txin')
   call assert_equal(['startdef', 'ghi'], getline(1, '$'))
+  " start select mode again with gv
+  set selectmode=cmd
+  call feedkeys('gvabc', 'xt')
+  call assert_equal('abctdef', getline(1))
   set selectmode= keymodel=
   bw!
 endfunc
@@ -1263,6 +1267,16 @@ func Test_edit_forbidden()
   catch /^Vim\%((\a\+)\)\=:E117/ " catch E117: unknown function
   endtry
   au! InsertCharPre
+  " 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
   " 3) edit when completion is shown
   fun! Complete(findstart, base)
     if a:findstart