summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_functions.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-03-04 11:40:12 +0100
committerBram Moolenaar <Bram@vim.org>2019-03-04 11:40:12 +0100
commitcce713ddcc0c9ab29926c28e287cbb587a959b08 (patch)
treeb038987ac55e7d42c33d00c88e71e0d1eb750add /src/testdir/test_functions.vim
parent975880b6e6de473b512995ef87ce072aaca934cf (diff)
patch 8.1.0992: a :normal command resets the reg_executing() resultv8.1.0992
Problem: A :normal command while executing a register resets the reg_executing() result. Solution: Save and restore reg_executing. (closes #4066)
Diffstat (limited to 'src/testdir/test_functions.vim')
-rw-r--r--src/testdir/test_functions.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/testdir/test_functions.vim b/src/testdir/test_functions.vim
index a7caf22408..43c0f63c21 100644
--- 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