From ff75f345ab5fa57c6560db021e8eb099aff90472 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 22 Nov 2024 06:52:32 +0800 Subject: fix(highlight): 'winhl' shouldn't take priority over API (#31288) --- src/nvim/option.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/nvim/option.c') diff --git a/src/nvim/option.c b/src/nvim/option.c index 1cfe4cd08b..d3cbe9f056 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1736,8 +1736,14 @@ bool parse_winhl_opt(const char *winhl, win_T *wp) p = wp->w_p_winhl; } + if (wp != NULL && wp->w_ns_hl_winhl < 0) { + // 'winhighlight' shouldn't be used for this window. + // Only check that the value is valid. + wp = NULL; + } + if (!*p) { - if (wp != NULL && wp->w_ns_hl_winhl && wp->w_ns_hl == wp->w_ns_hl_winhl) { + if (wp != NULL && wp->w_ns_hl_winhl > 0 && wp->w_ns_hl == wp->w_ns_hl_winhl) { wp->w_ns_hl = 0; wp->w_hl_needs_update = true; } -- cgit