feat(highlight): define the concept of altfont as a (c)term rendering attribute

This commit is contained in:
Paul "LeoNerd" Evans
2023-01-19 23:18:21 +00:00
parent f5d357de55
commit f3039ce531
9 changed files with 35 additions and 8 deletions

View File

@@ -867,6 +867,10 @@ void hlattrs2dict(Dictionary *dict, HlAttrs ae, bool use_rgb)
PUT_C(hl, "strikethrough", BOOLEAN_OBJ(true));
}
if (mask & HL_ALTFONT) {
PUT_C(hl, "altfont", BOOLEAN_OBJ(true));
}
if (mask & HL_NOCOMBINE) {
PUT_C(hl, "nocombine", BOOLEAN_OBJ(true));
}
@@ -932,6 +936,7 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e
CHECK_FLAG(dict, mask, underdashed, , HL_UNDERDASHED);
CHECK_FLAG(dict, mask, standout, , HL_STANDOUT);
CHECK_FLAG(dict, mask, strikethrough, , HL_STRIKETHROUGH);
CHECK_FLAG(dict, mask, altfont, , HL_ALTFONT);
if (use_rgb) {
CHECK_FLAG(dict, mask, fg_indexed, , HL_FG_INDEXED);
CHECK_FLAG(dict, mask, bg_indexed, , HL_BG_INDEXED);
@@ -1014,6 +1019,7 @@ HlAttrs dict2hlattrs(Dict(highlight) *dict, bool use_rgb, int *link_id, Error *e
CHECK_FLAG(cterm, cterm_mask, undercurl, , HL_UNDERCURL);
CHECK_FLAG(cterm, cterm_mask, standout, , HL_STANDOUT);
CHECK_FLAG(cterm, cterm_mask, strikethrough, , HL_STRIKETHROUGH);
CHECK_FLAG(cterm, cterm_mask, altfont, , HL_ALTFONT);
CHECK_FLAG(cterm, cterm_mask, nocombine, , HL_NOCOMBINE);
} else if (dict->cterm.type == kObjectTypeArray && dict->cterm.data.array.size == 0) {
// empty list from Lua API should clear all cterm attributes