typedef struct hl_overrides_S hl_overrides_T;
struct hl_overrides_S
{
- hl_override_T *arr; // May be NULL if "arr" was freed
+ hl_override_T *arr; // May be NULL if "arr" was freed or no highlight
+ // overrides (all values set to default)
int len;
hl_overrides_T *next; // Used to handle recursive calls
bool
push_highlight_overrides(hl_override_T *arr, int len)
{
- // Don't want to do anything if "arr" is NULL or if "arr" is already the
- // current override.
- if (arr == NULL || (overrides != NULL && overrides->arr == arr))
+ // Don't want to do anything if "arr" is already the current override. If
+ // "arr" is NULL (but overrides->arr is not), then still push an override,
+ // but "->arr" will just be NULL so any previous overrides are cleared.
+ if (overrides != NULL && overrides->arr == arr)
return false;
hl_overrides_T *set;
memcpy(highlight_attr, highlight_attr_raw, sizeof(highlight_attr));
// Update highlight_attr[] array
- set_highlight_attr(arr, len, false);
+ if (arr != NULL)
+ set_highlight_attr(arr, len, false);
return true;
}
--- /dev/null
+> +0&#ffffff0@36||+1&&| +0&&@36
+|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|[+0#ffffff16#e000002|N|o| |N|a|m|e|]| @9|0|,|0|-|1| @9|A|l@1| |[+1#0000000#ffffff0|N|o| |N|a|m|e|]| @9|0|,|0|-|1| @9|A|l@1
+| +0&&@74
--- /dev/null
+| +0&#ffffff0@36||+1&&> +0&&@36
+|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|~| @35||+1#0000000&|~+0#4040ff13&| @35
+|[+1#0000000&|N|o| |N|a|m|e|]| @9|0|,|0|-|1| @9|A|l@1| +3&&|[|N|o| |N|a|m|e|]| @9|0|,|0|-|1| @9|A|l@1
+| +0&&@74
call StopVimInTerminal(buf)
endfunc
+" Test that 'winhighlight' of window left of separator does not apply when
+" drawing the window to the right of the separator.
+func Test_VertSplitNC_winhighlight()
+ CheckScreendump
+
+ let lines =<< trim END
+ vsplit
+ set winhighlight=StatusLine:ErrorMsg
+ END
+ call writefile(lines, 'Xtest_vertsplitNC_winhighlight', 'D')
+
+ let buf = RunVimInTerminal('-S Xtest_vertsplitNC_winhighlight', {'rows': 12})
+ call TermWait(buf)
+
+ call VerifyScreenDump(buf, 'Test_VertSplitNC_whl1', {})
+
+ call term_sendkeys(buf, "\<C-w>\<C-l>") " Go to window with empty winhighlight
+ call TermWait(buf)
+
+ call VerifyScreenDump(buf, 'Test_VertSplitNC_whl2', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 352,
/**/
351,
/**/