// When receiving a modifier, wait for the modified key.
goto ret_false;
c = TO_SPECIAL(state->prev_c, c);
- if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
- // Drop K_FOCUSGAINED and K_FOCUSLOST, they are not useful
- // in a recording.
+ // Drop K_FOCUSGAINED, K_FOCUSLOST and K_COMPLETE_DELAY, they are
+ // not useful in a recording.
+ if (c == K_FOCUSGAINED || c == K_FOCUSLOST || c == K_COMPLETE_DELAY)
state->buflen = 0;
}
// When receiving a multibyte character, store it until we have all
let @a = ''
" Type a char that arms the delay, idle past 'autocompletedelay' so a
" K_COMPLETE_DELAY would be injected, then end Insert mode and stop recording.
- call timer_start(200, { -> feedkeys("\<Esc>q", 't') })
+ call timer_start(300, { -> feedkeys("\<Esc>q", 't') })
call feedkeys("qaSf", 'tx!')
call assert_equal("Sf\<Esc>", @a)
+ " Delayed autocompletion still works when recording.
+ if !has('win32') " FIXME: does not work on Windows
+ call setline(1, 'foobar foofoo')
+ call timer_start(300, { -> feedkeys("\<Down>\<C-Y>\<Esc>q", 't') })
+ call feedkeys("qaof", 'tx!')
+ call assert_equal('foobar', getline('.'))
+ " XXX: This doesn't produce the same result when replaying.
+ call assert_equal("of\<Down>\<C-Y>\<Esc>", @a)
+ endif
+
set autocomplete& autocompletedelay&
bwipe!
endfunc
// 'autocompletedelay' and 'updatetime' so the delay does not postpone
// CursorHold. Once CursorHold has fired, only the delay is left.
// Gate the injection like trigger_cursorhold() so the deferred key
- // cannot fire while recording or outside Insert mode.
+ // cannot fire while outside Insert mode, but do still fire the key
+ // when recording a register (gotchars_add_byte() will ignore it).
bool delay_pending = ins_compl_autocomplete_pending() && p_acl > 0
- && reg_recording == 0
&& typebuf.tb_len == 0
&& !ins_compl_active()
&& (get_real_state() & MODE_INSERT) != 0;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 755,
/**/
754,
/**/