summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_registers.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-09 17:58:49 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-09 17:58:49 +0100
commit81b46a6ccd818609e1ca8cd410e26a58428c30ba (patch)
treec1fabec0ac2a5470e3e347ebb5a873bb2243b629 /src/testdir/test_registers.vim
parent36951ed1dab2b2e816dc8959c72b5732f36d9e3b (diff)
patch 8.2.4722: ending recording with mapping records too muchv8.2.4722
Problem: When a recording is ended with a mapped key that key is also recorded. Solution: Remember the previous last_recorded_len. (closes #10122)
Diffstat (limited to 'src/testdir/test_registers.vim')
-rw-r--r--src/testdir/test_registers.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/testdir/test_registers.vim b/src/testdir/test_registers.vim
index 51543c00c1..3522649812 100644
--- a/src/testdir/test_registers.vim
+++ b/src/testdir/test_registers.vim
@@ -759,6 +759,27 @@ func Test_record_in_select_mode()
bwipe!
endfunc
+" mapping that ends macro recording should be removed from recorded macro
+func Test_end_record_using_mapping()
+ call setline(1, 'aaa')
+ nnoremap s q
+ call feedkeys('safas', 'tx')
+ call assert_equal('fa', @a)
+ nunmap s
+
+ nnoremap xx q
+ call feedkeys('0xxafaxx', 'tx')
+ call assert_equal('fa', @a)
+ nunmap xx
+
+ nnoremap xsx q
+ call feedkeys('0qafaxsx', 'tx')
+ call assert_equal('fa', @a)
+ nunmap xsx
+
+ bwipe!
+endfunc
+
func Test_end_reg_executing()
nnoremap s <Nop>
let @a = 's'