mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +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:
@@ -444,7 +444,7 @@ void spell_suggest(int count)
|
||||
char wcopy[MAXWLEN + 2];
|
||||
suginfo_T sug;
|
||||
suggest_T *stp;
|
||||
bool mouse_used;
|
||||
bool mouse_used = false;
|
||||
int selected = count;
|
||||
int badlen = 0;
|
||||
int msg_scroll_save = msg_scroll;
|
||||
@@ -594,15 +594,11 @@ void spell_suggest(int count)
|
||||
cmdmsg_rl = false;
|
||||
msg_col = 0;
|
||||
// Ask for choice.
|
||||
selected = prompt_for_number(&mouse_used);
|
||||
|
||||
if (ui_has(kUIMessages)) {
|
||||
ui_call_msg_clear();
|
||||
}
|
||||
|
||||
selected = prompt_for_input(NULL, 0, false, &mouse_used);
|
||||
if (mouse_used) {
|
||||
selected -= lines_left;
|
||||
selected = sug.su_ga.ga_len + 1 - (cmdline_row - mouse_row);
|
||||
}
|
||||
|
||||
lines_left = Rows; // avoid more prompt
|
||||
// don't delay for 'smd' in normal_cmd()
|
||||
msg_scroll = msg_scroll_save;
|
||||
|
Reference in New Issue
Block a user