diff src/testdir/test_functions.vim @ 15973:393a9a3a2da2 v8.1.0992

patch 8.1.0992: a :normal command resets the reg_executing() result commit https://github.com/vim/vim/commit/cce713ddcc0c9ab29926c28e287cbb587a959b08 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 4 11:40:12 2019 +0100 patch 8.1.0992: a :normal command resets the reg_executing() result Problem: A :normal command while executing a register resets the reg_executing() result. Solution: Save and restore reg_executing. (closes #4066)
author Bram Moolenaar <Bram@vim.org>
date Mon, 04 Mar 2019 11:45:07 +0100
parents c4efa095f323
children 72987a858c96
line wrap: on
line diff
--- a/src/testdir/test_functions.vim
+++ b/src/testdir/test_functions.vim
@@ -1137,6 +1137,15 @@ func Test_reg_executing_and_recording()
   call feedkeys("q\"\"=s:save_reg_stat()\<CR>pq", 'xt')
   call assert_equal('":', s:reg_stat)
 
+  " :normal command saves and restores reg_executing
+  let @q = ":call TestFunc()\<CR>:call s:save_reg_stat()\<CR>"
+  func TestFunc() abort
+    normal! ia
+  endfunc
+  call feedkeys("@q", 'xt')
+  call assert_equal(':q', s:reg_stat)
+  delfunc TestFunc
+
   bwipe!
   delfunc s:save_reg_stat
   unlet s:reg_stat