mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(tui): clear primary device callback before invoking it (#34032)
A primary device callback may set a new callback (e.g. when suspending),
so clearing it after invoking it is too late.
While at it, add missing reset of did_set_grapheme_cluster_mode in
terminfo_start().
(cherry picked from commit 17e13ce3b6
)
This commit is contained in:
committed by
github-actions[bot]
parent
27abf5c81b
commit
12ae7aa846
@ -659,8 +659,10 @@ static void handle_unknown_csi(TermInput *input, const TermKeyKey *key)
|
||||
case '?':
|
||||
// Primary Device Attributes (DA1) response
|
||||
if (input->callbacks.primary_device_attr) {
|
||||
input->callbacks.primary_device_attr(input->tui_data);
|
||||
void (*cb_save)(TUIData *) = input->callbacks.primary_device_attr;
|
||||
// Clear the callback before invoking it, as it may set a new callback. #34031
|
||||
input->callbacks.primary_device_attr = NULL;
|
||||
cb_save(input->tui_data);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -360,6 +360,7 @@ static void terminfo_start(TUIData *tui)
|
||||
tui->overflow = false;
|
||||
tui->set_cursor_color_as_str = false;
|
||||
tui->cursor_has_color = false;
|
||||
tui->did_set_grapheme_cluster_mode = false;
|
||||
tui->showing_mode = SHAPE_IDX_N;
|
||||
tui->unibi_ext.enable_mouse = -1;
|
||||
tui->unibi_ext.disable_mouse = -1;
|
||||
|
Reference in New Issue
Block a user