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

@@ -2161,11 +2161,11 @@ Dict nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Arena *arena,
if (num_id) {
stc_hl_id = num_id;
} else if (statuscol.use_cul) {
stc_hl_id = HLF_CLN + 1;
stc_hl_id = HLF_CLN;
} else if (wp->w_p_rnu) {
stc_hl_id = (lnum < wp->w_cursor.lnum ? HLF_LNA : HLF_LNB) + 1;
stc_hl_id = (lnum < wp->w_cursor.lnum ? HLF_LNA : HLF_LNB);
} else {
stc_hl_id = HLF_N + 1;
stc_hl_id = HLF_N;
}
set_vim_var_nr(VV_LNUM, lnum);