refactor(message): propagate highlight id instead of attrs

Problem:  Highlight group id is not propagated to the end of the message call
          stack, where ext_messages are emitted.
Solution: Refactor message functions to pass along highlight group id
          instead of attr id.
This commit is contained in:
Luuk van Baal
2024-02-20 17:25:57 +01:00
parent 5a86360400
commit 5cfa7a72f8
45 changed files with 441 additions and 473 deletions

View File

@@ -2595,13 +2595,12 @@ static void u_undo_end(bool did_undo, bool absolute, bool quiet)
check_pos(curbuf, &VIsual);
}
smsg_attr_keep(0,
_("%" PRId64 " %s; %s #%" PRId64 " %s"),
u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount,
_(msgstr),
did_undo ? _("before") : _("after"),
uhp == NULL ? 0 : (int64_t)uhp->uh_seq,
msgbuf);
smsg_hl_keep(0, _("%" PRId64 " %s; %s #%" PRId64 " %s"),
u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount,
_(msgstr),
did_undo ? _("before") : _("after"),
uhp == NULL ? 0 : (int64_t)uhp->uh_seq,
msgbuf);
}
/// Put the timestamp of an undo header in "buf[buflen]" in a nice format.
@@ -2713,8 +2712,7 @@ void ex_undolist(exarg_T *eap)
sort_strings(ga.ga_data, ga.ga_len);
msg_start();
msg_puts_attr(_("number changes when saved"),
HL_ATTR(HLF_T));
msg_puts_hl(_("number changes when saved"), HLF_T + 1, false);
for (int i = 0; i < ga.ga_len && !got_int; i++) {
msg_putchar('\n');
if (got_int) {