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.
This commit is contained in:
bfredl
2024-11-11 13:06:37 +01:00
parent eaf5ae6cc6
commit ff7518b83c
35 changed files with 113 additions and 112 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_hl("*", HLF_8 + 1, false);
msg_puts_hl("*", HLF_8, false);
} else if (mp->m_noremap == REMAP_SCRIPT) {
msg_puts_hl("&", HLF_8 + 1, false);
msg_puts_hl("&", HLF_8, 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_hl(str, HLF_8 + 1, false);
msg_puts_hl(str, HLF_8, false);
xfree(str);
} else if (mp->m_str[0] == NUL) {
msg_puts_hl("<Nop>", HLF_8 + 1, false);
msg_puts_hl("<Nop>", HLF_8, false);
} else {
msg_outtrans_special(mp->m_str, false, 0);
}