}
else
{
+ // number of characters recorded from the last vgetc() call
+ static int last_vgetc_recorded_len = 0;
+
mod_mask = 0;
vgetc_mod_mask = 0;
vgetc_char = 0;
- last_recorded_len = 0;
+
+ // last_recorded_len can be larger than last_vgetc_recorded_len
+ // if peeking records more
+ last_recorded_len -= last_vgetc_recorded_len;
for (;;) // this is done twice if there are modifiers
{
break;
}
+
+ last_vgetc_recorded_len = last_recorded_len;
}
#ifdef FEAT_EVAL
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'