mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 05:28:33 +00:00
fix(ui): no fast context for prompt message kinds #31224
Problem: No longer able to show prompt messages with vim.ui_attach(). Solution: Do not execute callback in fast context for prompt message kinds. These events must be safe to show the incoming message so the event itself serves to indicate that the message should be shown immediately.
This commit is contained in:
@@ -717,6 +717,13 @@ void ui_call_event(char *name, bool fast, Array args)
|
||||
{
|
||||
bool handled = false;
|
||||
UIEventCallback *event_cb;
|
||||
|
||||
// Prompt messages should be shown immediately so must be safe
|
||||
if (strcmp(name, "msg_show") == 0) {
|
||||
char *kind = args.items[0].data.string.data;
|
||||
fast = !kind || (strncmp(kind, "confirm", 7) != 0 && strcmp(kind, "return_prompt") != 0);
|
||||
}
|
||||
|
||||
map_foreach(&ui_event_cbs, ui_event_ns_id, event_cb, {
|
||||
Error err = ERROR_INIT;
|
||||
uint32_t ns_id = ui_event_ns_id;
|
||||
|
Reference in New Issue
Block a user