applyMatchOrHint function
({int bg, int fg})
applyMatchOrHint(
- int flags,
- ({int bg, int fg}) ec,
- SearchColors search,
- HintColors hint,
Effective fg/bg with full precedence: focused-match > match > hyperlink > base.
Implementation
({int fg, int bg}) applyMatchOrHint(
int flags, ({int fg, int bg}) ec, SearchColors search, HintColors hint) {
if (flags & kFlagMatchCurrent != 0) {
return (fg: search.focusedFg, bg: search.focusedBg);
}
if (flags & kFlagMatch != 0) {
return (fg: search.matchFg, bg: search.matchBg);
}
if (flags & kFlagHyperlink != 0) {
return (fg: hint.fg, bg: hint.bg);
}
return ec;
}