From 5cfa7a72f8c40cdcc0fa93693689915e913806f1 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Tue, 20 Feb 2024 17:25:57 +0100 Subject: 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. --- src/nvim/sign.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nvim/sign.c') diff --git a/src/nvim/sign.c b/src/nvim/sign.c index b4ba7833e9..ec342d8b50 100644 --- a/src/nvim/sign.c +++ b/src/nvim/sign.c @@ -270,7 +270,7 @@ static void sign_list_placed(buf_T *rbuf, char *group) while (buf != NULL && !got_int) { if (buf_has_signs(buf)) { vim_snprintf(lbuf, MSG_BUF_LEN, _("Signs for %s:"), buf->b_fname); - msg_puts_attr(lbuf, HL_ATTR(HLF_D)); + msg_puts_hl(lbuf, HLF_D + 1, false); msg_putchar('\n'); } @@ -481,14 +481,14 @@ static void sign_list_defined(sign_T *sp) smsg(0, "sign %s", sp->sn_name); if (sp->sn_icon != NULL) { msg_puts(" icon="); - msg_outtrans(sp->sn_icon, 0); + msg_outtrans(sp->sn_icon, 0, false); msg_puts(_(" (not supported)")); } if (sp->sn_text[0]) { msg_puts(" text="); char buf[SIGN_WIDTH * MAX_SCHAR_SIZE]; describe_sign_text(buf, sp->sn_text); - msg_outtrans(buf, 0); + msg_outtrans(buf, 0, false); } if (sp->sn_priority > 0) { char lbuf[MSG_BUF_LEN]; -- cgit From ff7518b83cb270f8fcaded19bf640cf4bdfb0ff0 Mon Sep 17 00:00:00 2001 From: bfredl Date: Mon, 11 Nov 2024 13:06:37 +0100 Subject: refactor(highlight): make enum of builtin highlights start with 1 This makes it possible to use HLF_ values directly as highlight id:s and avoids +1 adjustments especially around messages. --- src/nvim/sign.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/sign.c') diff --git a/src/nvim/sign.c b/src/nvim/sign.c index ec342d8b50..f8e7eeaca4 100644 --- a/src/nvim/sign.c +++ b/src/nvim/sign.c @@ -270,7 +270,7 @@ static void sign_list_placed(buf_T *rbuf, char *group) while (buf != NULL && !got_int) { if (buf_has_signs(buf)) { vim_snprintf(lbuf, MSG_BUF_LEN, _("Signs for %s:"), buf->b_fname); - msg_puts_hl(lbuf, HLF_D + 1, false); + msg_puts_hl(lbuf, HLF_D, false); msg_putchar('\n'); } -- cgit