mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 17:36:29 +00:00
fix(highlight): avoid ORing underline flags (#22372)
When combining attributes use the one that takes priority. For :highlight command use the last one specified. For API use a hard-coded order same as the order in docs.
This commit is contained in:
@@ -1124,6 +1124,9 @@ void do_highlight(const char *line, const bool forceit, const bool init)
|
||||
for (i = ARRAY_SIZE(hl_attr_table); --i >= 0;) {
|
||||
int len = (int)strlen(hl_name_table[i]);
|
||||
if (STRNICMP(arg + off, hl_name_table[i], len) == 0) {
|
||||
if (hl_attr_table[i] & HL_UNDERLINE_MASK) {
|
||||
attr &= ~HL_UNDERLINE_MASK;
|
||||
}
|
||||
attr |= hl_attr_table[i];
|
||||
off += len;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user