mirror of
https://github.com/neovim/neovim.git
synced 2026-08-26 17:11:48 +00:00
fix(events): always allow some events to be nested (#32706)
Always allow the following four events to be nested, as they may contain important information, and are triggered on the event loop, which may be processed by a blocking call inside another autocommand. - ChanInfo - ChanOpen - TermRequest - TermResponse There are some other events that are triggered on the event loop, but they are mostly triggered by user actions in a UI client, and therefore not very likely to happen during another autocommand, so leave them unchanged for now.
This commit is contained in:
@@ -510,7 +510,7 @@ void nvim_ui_term_event(uint64_t channel_id, String event, Object value, Error *
|
||||
|
||||
MAXSIZE_TEMP_DICT(data, 1);
|
||||
PUT_C(data, "sequence", value);
|
||||
apply_autocmds_group(EVENT_TERMRESPONSE, NULL, NULL, false, AUGROUP_ALL, NULL, NULL,
|
||||
apply_autocmds_group(EVENT_TERMRESPONSE, NULL, NULL, true, AUGROUP_ALL, NULL, NULL,
|
||||
&DICT_OBJ(data));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -897,7 +897,7 @@ static void set_info_event(void **argv)
|
||||
tv_dict_add_dict(dict, S_LEN("info"), retval.vval.v_dict);
|
||||
tv_dict_set_keys_readonly(dict);
|
||||
|
||||
apply_autocmds(event, NULL, NULL, false, curbuf);
|
||||
apply_autocmds(event, NULL, NULL, true, curbuf);
|
||||
|
||||
restore_v_event(dict, &save_v_event);
|
||||
arena_mem_free(arena_finish(&arena));
|
||||
|
||||
@@ -243,7 +243,7 @@ static void emit_termrequest(void **argv)
|
||||
PUT_C(data, "cursor", ARRAY_OBJ(cursor));
|
||||
|
||||
buf_T *buf = handle_get_buffer(term->buf_handle);
|
||||
apply_autocmds_group(EVENT_TERMREQUEST, NULL, NULL, false, AUGROUP_ALL, buf, NULL,
|
||||
apply_autocmds_group(EVENT_TERMREQUEST, NULL, NULL, true, AUGROUP_ALL, buf, NULL,
|
||||
&DICT_OBJ(data));
|
||||
xfree(sequence);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user