mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
feat(highlight): define the concept of altfont as a (c)term rendering attribute
This commit is contained in:
@@ -67,11 +67,13 @@ Map(cstr_t, int) highlight_unames = MAP_INIT;
|
||||
static char *(hl_name_table[]) =
|
||||
{ "bold", "standout", "underline",
|
||||
"undercurl", "underdouble", "underdotted", "underdashed",
|
||||
"italic", "reverse", "inverse", "strikethrough", "nocombine", "NONE" };
|
||||
"italic", "reverse", "inverse", "strikethrough", "altfont",
|
||||
"nocombine", "NONE" };
|
||||
static int hl_attr_table[] =
|
||||
{ HL_BOLD, HL_STANDOUT, HL_UNDERLINE,
|
||||
HL_UNDERCURL, HL_UNDERDOUBLE, HL_UNDERDOTTED, HL_UNDERDASHED,
|
||||
HL_ITALIC, HL_INVERSE, HL_INVERSE, HL_STRIKETHROUGH, HL_NOCOMBINE, 0 };
|
||||
HL_ITALIC, HL_INVERSE, HL_INVERSE, HL_STRIKETHROUGH, HL_ALTFONT,
|
||||
HL_NOCOMBINE, 0 };
|
||||
|
||||
/// Structure that stores information about a highlight group.
|
||||
/// The ID of a highlight group is also called group ID. It is the index in
|
||||
@@ -1595,7 +1597,12 @@ const char *highlight_has_attr(const int id, const int flag, const int modec)
|
||||
attr = hl_table[id - 1].sg_cterm;
|
||||
}
|
||||
|
||||
return (attr & flag) ? "1" : NULL;
|
||||
if (flag & HL_UNDERLINE_MASK) {
|
||||
int ul = attr & HL_UNDERLINE_MASK;
|
||||
return ul == flag ? "1" : NULL;
|
||||
} else {
|
||||
return (attr & flag) ? "1" : NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/// Return color name of the given highlight group
|
||||
|
Reference in New Issue
Block a user