fix(messages): list_cmd kind for :registers, :au[g] #32531

Problem:  No kind for `:registers/autocmd/augroup` messages. `:registers`
          chunks are emitted as separate `msg_show` events.

Solution: Add the `list_cmd` kind to the message. Introduce a new
          `msg_ext_skip_flush` variable to set to true around a
          group of to be paired message chunks.
This commit is contained in:
luukvbaal
2025-02-21 01:40:21 +01:00
committed by GitHub
parent f4cd5a33b6
commit 08f7c22377
5 changed files with 82 additions and 50 deletions

View File

@@ -3770,10 +3770,16 @@ void ex_display(exarg_T *eap)
}
int hl_id = HLF_8;
msg_ext_set_kind("list_cmd");
msg_ext_skip_flush = true;
// Highlight title
msg_puts_title(_("\nType Name Content"));
for (int i = -1; i < NUM_REGISTERS && !got_int; i++) {
int name = get_register_name(i);
if (arg != NULL && vim_strchr(arg, name) == NULL) {
continue; // did not ask for this register
}
switch (get_reg_type(name, NULL)) {
case kMTLineWise:
type = 'l'; break;
@@ -3783,10 +3789,6 @@ void ex_display(exarg_T *eap)
type = 'b'; break;
}
if (arg != NULL && vim_strchr(arg, name) == NULL) {
continue; // did not ask for this register
}
if (i == -1) {
if (y_previous != NULL) {
yb = y_previous;
@@ -3890,6 +3892,7 @@ void ex_display(exarg_T *eap)
msg_puts("\n c \"= ");
dis_msg(expr_line, false);
}
msg_ext_skip_flush = false;
}
/// display a string for do_dis()