aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/funcs.c
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2025-01-02 14:51:03 +0100
committerGitHub <noreply@github.com>2025-01-02 05:51:03 -0800
commit48e2a73610ca5639408f79b3d8eebd3e5f57a327 (patch)
treee84d5ab3decc765d7532c172d961fcd554d5b23a /src/nvim/eval/funcs.c
parent9d9ee3476e6478850ce8822c85154f0c98570371 (diff)
downloadrneovim-48e2a73610ca5639408f79b3d8eebd3e5f57a327.tar.gz
rneovim-48e2a73610ca5639408f79b3d8eebd3e5f57a327.tar.bz2
rneovim-48e2a73610ca5639408f79b3d8eebd3e5f57a327.zip
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.
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r--src/nvim/eval/funcs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index fbaa6e679f..ed3efca0d7 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -3557,10 +3557,10 @@ static void f_inputlist(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
});
// Ask for choice.
- bool mouse_used;
- int selected = prompt_for_number(&mouse_used);
+ bool mouse_used = false;
+ int selected = prompt_for_input(NULL, 0, false, &mouse_used);
if (mouse_used) {
- selected -= lines_left;
+ selected = tv_list_len(argvars[0].vval.v_list) - (cmdline_row - mouse_row);
}
rettv->vval.v_number = selected;