vim-patch:8.1.0851: feedkeys() with "L" does not work properly

Problem:    feedkeys() with "L" does not work properly.
Solution:   Do not set typebuf_was_filled when using "L". (Ozaki Kiichi,
            closes vim/vim#3885)
8d4ce56a19
This commit is contained in:
Jan Edmund Lazo 2020-01-03 22:58:09 -05:00
parent e7d49dc909
commit 3a3fb08602
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
4 changed files with 8 additions and 9 deletions

View File

@ -241,15 +241,15 @@ void nvim_feedkeys(String keys, String mode, Boolean escape_csi)
keys_esc = keys.data;
}
ins_typebuf((char_u *)keys_esc, (remap ? REMAP_YES : REMAP_NONE),
insert ? 0 : typebuf.tb_len, !typed, false);
insert ? 0 : typebuf.tb_len, !typed, false);
if (vgetc_busy) {
typebuf_was_filled = true;
}
if (escape_csi) {
xfree(keys_esc);
}
if (vgetc_busy) {
typebuf_was_filled = true;
}
if (execute) {
int save_msg_scroll = msg_scroll;

View File

@ -52,7 +52,7 @@ if has('timers')
au CursorHoldI * let g:triggered += 1
set updatetime=500
call job_start(has('win32') ? 'cmd /c echo:' : 'echo',
\ {'exit_cb': {j, s -> timer_start(1000, 'ExitInsertMode')}})
\ {'exit_cb': {-> timer_start(1000, 'ExitInsertMode')}})
call feedkeys('a', 'x!')
call assert_equal(1, g:triggered)
unlet g:triggered

View File

@ -287,7 +287,7 @@ func Test_map_timeout_with_timer_interrupt()
set timeout timeoutlen=200
func ExitCb(job, status)
let g:timer = timer_start(1, {_ -> feedkeys("3\<Esc>", 't')})
let g:timer = timer_start(1, {-> feedkeys("3\<Esc>", 't')})
endfunc
call job_start([&shell, &shellcmdflag, 'echo'], {'exit_cb': 'ExitCb'})

View File

@ -254,15 +254,14 @@ func Test_peek_and_get_char()
endfunc
func Test_getchar_zero()
if has('win32')
if has('win32') && !has('gui_running')
" Console: no low-level input
" GUI: somehow doesn't work
return
endif
" Measure the elapsed time to avoid a hang when it fails.
let start = reltime()
let id = timer_start(20, {id -> feedkeys('x', 'L')})
let id = timer_start(20, {-> feedkeys('x', 'L')})
let c = 0
while c == 0 && reltimefloat(reltime(start)) < 0.2
let c = getchar(0)