refactor: allow us to process a child queue only while waiting on input

This commit is contained in:
Björn Linse
2019-09-06 20:10:56 +02:00
parent fa90f6cdaa
commit e6b7613e89
12 changed files with 69 additions and 78 deletions

View File

@@ -9941,9 +9941,7 @@ static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr)
if (argvars[0].v_type == VAR_UNKNOWN) {
// getchar(): blocking wait.
if (!(char_avail() || using_script() || input_available())) {
input_enable_events();
(void)os_inchar(NULL, 0, -1, 0);
input_disable_events();
(void)os_inchar(NULL, 0, -1, 0, main_loop.events);
if (!multiqueue_empty(main_loop.events)) {
multiqueue_process_events(main_loop.events);
continue;