mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 06:28:35 +00:00
feat(ui)!: emit prompt "messages" as cmdline events #31525
Problem: Prompts are emitted as messages events, where cmdline events are more appropriate. The user input is also emitted as message events in fast context, so cannot be displayed with vim.ui_attach(). Solution: Prompt for user input through cmdline prompts.
This commit is contained in:
@@ -717,10 +717,10 @@ 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
|
||||
// Return prompt is still a non-fast event, other prompt messages are
|
||||
// followed by a "cmdline_show" event.
|
||||
if (strcmp(name, "msg_show") == 0) {
|
||||
char *kind = args.items[0].data.string.data;
|
||||
fast = !kind || ((strncmp(kind, "confirm", 7) != 0 && strstr(kind, "_prompt") == NULL));
|
||||
fast = !strequal(args.items[0].data.string.data, "return_prompt");
|
||||
}
|
||||
|
||||
map_foreach(&ui_event_cbs, ui_event_ns_id, event_cb, {
|
||||
|
Reference in New Issue
Block a user