diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 95caaa621b..6e5d79b530 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1177,6 +1177,7 @@ int do_execreg(int regname, int colon, int addcr, int silent) } } reg_executing = regname == 0 ? '"' : regname; // disable the 'q' command + pending_end_reg_executing = false; } return retval; } diff --git a/test/old/testdir/test_registers.vim b/test/old/testdir/test_registers.vim index 45a940b3b1..9e1beb1dd2 100644 --- a/test/old/testdir/test_registers.vim +++ b/test/old/testdir/test_registers.vim @@ -800,6 +800,23 @@ func Test_end_reg_executing() bwipe! endfunc +func Test_reg_executing_in_range_normal() + new + set showcmd + call setline(1, range(10)) + let g:log = [] + nnoremap s let g:log += [reg_executing()] + let @r = 's' + + %normal @r + call assert_equal(repeat(['r'], 10), g:log) + + nunmap s + unlet g:log + set showcmd& + bwipe! +endfunc + " An operator-pending mode mapping shouldn't be applied to keys typed in " Insert mode immediately after a character search when replaying. func Test_replay_charsearch_omap()