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

@@ -239,9 +239,9 @@ static void showmap(mapblock_T *mp, bool local)
} while (len < 12);
if (mp->m_noremap == REMAP_NONE) {
msg_puts_attr("*", HL_ATTR(HLF_8));
msg_puts_hl("*", HLF_8 + 1, false);
} else if (mp->m_noremap == REMAP_SCRIPT) {
msg_puts_attr("&", HL_ATTR(HLF_8));
msg_puts_hl("&", HLF_8 + 1, false);
} else {
msg_putchar(' ');
}
@@ -256,10 +256,10 @@ static void showmap(mapblock_T *mp, bool local)
// the rhs, and not M-x etc, true gets both -- webb
if (mp->m_luaref != LUA_NOREF) {
char *str = nlua_funcref_str(mp->m_luaref, NULL);
msg_puts_attr(str, HL_ATTR(HLF_8));
msg_puts_hl(str, HLF_8 + 1, false);
xfree(str);
} else if (mp->m_str[0] == NUL) {
msg_puts_attr("<Nop>", HL_ATTR(HLF_8));
msg_puts_hl("<Nop>", HLF_8 + 1, false);
} else {
msg_outtrans_special(mp->m_str, false, 0);
}
@@ -2657,7 +2657,7 @@ void ex_map(exarg_T *eap)
// If we are in a secure mode we print the mappings for security reasons.
if (secure) {
secure = 2;
msg_outtrans(eap->cmd, 0);
msg_outtrans(eap->cmd, 0, false);
msg_putchar('\n');
}
do_exmap(eap, false);