mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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 #3885)
This commit is contained in:
parent
98ad1e17c3
commit
8d4ce56a19
@ -3705,15 +3705,18 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
|
ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
|
||||||
insert ? 0 : typebuf.tb_len, !typed, FALSE);
|
insert ? 0 : typebuf.tb_len, !typed, FALSE);
|
||||||
vim_free(keys_esc);
|
|
||||||
if (vgetc_busy
|
if (vgetc_busy
|
||||||
#ifdef FEAT_TIMERS
|
#ifdef FEAT_TIMERS
|
||||||
|| timer_busy
|
|| timer_busy
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
typebuf_was_filled = TRUE;
|
typebuf_was_filled = TRUE;
|
||||||
|
}
|
||||||
|
vim_free(keys_esc);
|
||||||
|
|
||||||
if (execute)
|
if (execute)
|
||||||
{
|
{
|
||||||
int save_msg_scroll = msg_scroll;
|
int save_msg_scroll = msg_scroll;
|
||||||
|
@ -50,7 +50,7 @@ if has('timers')
|
|||||||
au CursorHoldI * let g:triggered += 1
|
au CursorHoldI * let g:triggered += 1
|
||||||
set updatetime=500
|
set updatetime=500
|
||||||
call job_start(has('win32') ? 'cmd /c echo:' : 'echo',
|
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 feedkeys('a', 'x!')
|
||||||
call assert_equal(1, g:triggered)
|
call assert_equal(1, g:triggered)
|
||||||
unlet g:triggered
|
unlet g:triggered
|
||||||
|
@ -215,7 +215,7 @@ func Test_map_timeout_with_timer_interrupt()
|
|||||||
set timeout timeoutlen=1000
|
set timeout timeoutlen=1000
|
||||||
|
|
||||||
func ExitCb(job, status)
|
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
|
endfunc
|
||||||
|
|
||||||
call job_start([&shell, &shellcmdflag, 'echo'], {'exit_cb': 'ExitCb'})
|
call job_start([&shell, &shellcmdflag, 'echo'], {'exit_cb': 'ExitCb'})
|
||||||
|
@ -251,15 +251,14 @@ func Test_peek_and_get_char()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_getchar_zero()
|
func Test_getchar_zero()
|
||||||
if has('win32')
|
if has('win32') && !has('gui_running')
|
||||||
" Console: no low-level input
|
" Console: no low-level input
|
||||||
" GUI: somehow doesn't work
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Measure the elapsed time to avoid a hang when it fails.
|
" Measure the elapsed time to avoid a hang when it fails.
|
||||||
let start = reltime()
|
let start = reltime()
|
||||||
let id = timer_start(20, {id -> feedkeys('x', 'L')})
|
let id = timer_start(20, {-> feedkeys('x', 'L')})
|
||||||
let c = 0
|
let c = 0
|
||||||
while c == 0 && reltimefloat(reltime(start)) < 0.2
|
while c == 0 && reltimefloat(reltime(start)) < 0.2
|
||||||
let c = getchar(0)
|
let c = getchar(0)
|
||||||
|
@ -783,6 +783,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
851,
|
||||||
/**/
|
/**/
|
||||||
850,
|
850,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user