aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2024-11-20 21:11:20 +0100
committerGitHub <noreply@github.com>2024-11-20 12:11:20 -0800
commit1b6442034f6a821d357fe59cd75fdae47a7f7cff (patch)
tree579c72ee7b2f78025407d58722f9abc992f12cc1 /src
parent0e2f92ed79e3c976ab5a41d40380e761e7f69d3a (diff)
downloadrneovim-1b6442034f6a821d357fe59cd75fdae47a7f7cff.tar.gz
rneovim-1b6442034f6a821d357fe59cd75fdae47a7f7cff.tar.bz2
rneovim-1b6442034f6a821d357fe59cd75fdae47a7f7cff.zip
fix(messages): more ext_messages kinds #31279
Add kinds for various commands that output a list, the 'wildmode' list, and for number prompts.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/buffer.c1
-rw-r--r--src/nvim/cmdexpand.c1
-rw-r--r--src/nvim/eval/funcs.c1
-rw-r--r--src/nvim/eval/vars.c1
-rw-r--r--src/nvim/ex_docmd.c2
-rw-r--r--src/nvim/highlight_group.c2
-rw-r--r--src/nvim/input.c1
-rw-r--r--src/nvim/mapping.c3
-rw-r--r--src/nvim/message.c4
-rw-r--r--src/nvim/option.c2
-rw-r--r--src/nvim/spellsuggest.c1
-rw-r--r--src/nvim/ui.c2
12 files changed, 18 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index abcce0dfe8..21079a1a3c 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -2819,6 +2819,7 @@ void buflist_list(exarg_T *eap)
garray_T buflist;
buf_T **buflist_data = NULL;
+ msg_ext_set_kind("list_cmd");
if (vim_strchr(eap->arg, 't')) {
ga_init(&buflist, sizeof(buf_T *), 50);
for (buf = firstbuf; buf != NULL; buf = buf->b_next) {
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c
index 700d554821..9b1193b4e0 100644
--- a/src/nvim/cmdexpand.c
+++ b/src/nvim/cmdexpand.c
@@ -1084,6 +1084,7 @@ int showmatches(expand_T *xp, bool wildmenu)
ui_flush();
cmdline_row = msg_row;
msg_didany = false; // lines_left will be set again
+ msg_ext_set_kind("wildlist");
msg_start(); // prepare for paging
}
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index 717280642d..f700e732a9 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -3540,6 +3540,7 @@ static void f_inputlist(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
return;
}
+ msg_ext_set_kind("list_cmd");
msg_start();
msg_row = Rows - 1; // for when 'cmdheight' > 1
lines_left = Rows; // avoid more prompt
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c
index 35ad00f373..3ecb446cd6 100644
--- a/src/nvim/eval/vars.c
+++ b/src/nvim/eval/vars.c
@@ -1403,6 +1403,7 @@ static void list_one_var(dictitem_T *v, const char *prefix, int *first)
static void list_one_var_a(const char *prefix, const char *name, const ptrdiff_t name_len,
const VarType type, const char *string, int *first)
{
+ msg_ext_set_kind("list_cmd");
// don't use msg() to avoid overwriting "v:statusmsg"
msg_start();
msg_puts(prefix);
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index f5ecedf827..9968f32de1 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -980,8 +980,6 @@ void handle_did_throw(void)
force_abort = true;
}
- msg_ext_set_kind("emsg"); // kind=emsg for :throw, exceptions. #9993
-
if (messages != NULL) {
do {
msglist_T *next = messages->next;
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index b3c4aca1af..8f026e9600 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -1001,6 +1001,7 @@ void do_highlight(const char *line, const bool forceit, const bool init)
{
// If no argument, list current highlighting.
if (!init && ends_excmd((uint8_t)(*line))) {
+ msg_ext_set_kind("list_cmd");
for (int i = 1; i <= highlight_ga.ga_len && !got_int; i++) {
// TODO(brammool): only call when the group has attributes set
highlight_list_one(i);
@@ -1038,6 +1039,7 @@ void do_highlight(const char *line, const bool forceit, const bool init)
if (id == 0) {
semsg(_(e_highlight_group_name_not_found_str), line);
} else {
+ msg_ext_set_kind("list_cmd");
highlight_list_one(id);
}
return;
diff --git a/src/nvim/input.c b/src/nvim/input.c
index 3d3240c59f..0c1a8af45f 100644
--- a/src/nvim/input.c
+++ b/src/nvim/input.c
@@ -223,6 +223,7 @@ int get_number(int colon, bool *mouse_used)
/// the line number.
int prompt_for_number(bool *mouse_used)
{
+ msg_ext_set_kind("number_prompt");
// When using ":silent" assume that <CR> was entered.
if (mouse_used != NULL) {
msg_puts(_("Type number and <Enter> or click with the mouse "
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c
index 1a6b2c3581..1896f042f2 100644
--- a/src/nvim/mapping.c
+++ b/src/nvim/mapping.c
@@ -581,6 +581,9 @@ static int buf_do_map(int maptype, MapArguments *args, int mode, bool is_abbrev,
const bool has_lhs = (args->lhs[0] != NUL);
const bool has_rhs = args->rhs_lua != LUA_NOREF || (args->rhs[0] != NUL) || args->rhs_is_noop;
const bool do_print = !has_lhs || (maptype != MAPTYPE_UNMAP && !has_rhs);
+ if (do_print) {
+ msg_ext_set_kind("list_cmd");
+ }
// check for :unmap without argument
if (maptype == MAPTYPE_UNMAP && !has_lhs) {
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 47f33c8967..c927a2546c 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -750,6 +750,10 @@ bool emsg_multiline(const char *s, bool multiline)
msg_scroll = true;
msg_source(hl_id);
+ if (msg_ext_kind == NULL) {
+ msg_ext_set_kind("emsg");
+ }
+
// Display the error message itself.
msg_nowait = false; // Wait for this msg.
return msg_hl_keep(s, hl_id, false, multiline);
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 8e94c342f7..1ce737bc59 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1276,6 +1276,7 @@ static void do_one_set_option(int opt_flags, char **argp, bool *did_show, char *
gotocmdline(true); // cursor at status line
*did_show = true; // remember that we did a line
}
+ msg_ext_set_kind("list_cmd");
showoneopt(&options[opt_idx], opt_flags);
if (p_verbose > 0) {
@@ -4048,6 +4049,7 @@ static void showoptions(bool all, int opt_flags)
vimoption_T **items = xmalloc(sizeof(vimoption_T *) * OPTION_COUNT);
+ msg_ext_set_kind("list_cmd");
// Highlight title
if (opt_flags & OPT_GLOBAL) {
msg_puts_title(_("\n--- Global option values ---"));
diff --git a/src/nvim/spellsuggest.c b/src/nvim/spellsuggest.c
index b37f01e769..0ddf4ffa38 100644
--- a/src/nvim/spellsuggest.c
+++ b/src/nvim/spellsuggest.c
@@ -516,6 +516,7 @@ void spell_suggest(int count)
spell_find_suggest(line + curwin->w_cursor.col, badlen, &sug, limit,
true, need_cap, true);
+ msg_ext_set_kind("list_cmd");
if (GA_EMPTY(&sug.su_ga)) {
msg(_("Sorry, no suggestions"), 0);
} else if (count > 0) {
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 7c81110ae9..eba821a53d 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -721,7 +721,7 @@ void ui_call_event(char *name, bool fast, Array args)
// 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);
+ fast = !kind || ((strncmp(kind, "confirm", 7) != 0 && strstr(kind, "_prompt") == NULL));
}
map_foreach(&ui_event_cbs, ui_event_ns_id, event_cb, {