From 6c3e170e5668e72b2b144a86b4e8278bc70daa48 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 11 Nov 2023 15:12:58 +0800 Subject: fix(highlight): apply 'winblend' to float border (#25981) --- src/nvim/highlight.c | 13 +++++++++---- src/nvim/option.c | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c index 88bf5dbd6e..a0114bbbe8 100644 --- a/src/nvim/highlight.c +++ b/src/nvim/highlight.c @@ -374,10 +374,15 @@ void update_window_hl(win_T *wp, bool invalid) if (wp->w_float_config.border_hl_ids[i]) { attr = hl_get_ui_attr(ns_id, HLF_BORDER, wp->w_float_config.border_hl_ids[i], false); - HlAttrs a = syn_attr2entry(attr); - if (a.hl_blend) { - wp->w_float_config.shadow = true; - } + } + HlAttrs a = syn_attr2entry(attr); + if (a.hl_blend == -1 && wp->w_p_winbl > 0) { + HlEntry entry = attr_entry(attr); + a.hl_blend = entry.attr.hl_blend = (int)wp->w_p_winbl; + attr = get_attr_entry(entry); + } + if (a.hl_blend > 0) { + wp->w_float_config.shadow = true; } wp->w_float_config.border_attr[i] = attr; } diff --git a/src/nvim/option.c b/src/nvim/option.c index 7005b63cac..690a03f1a0 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -2686,7 +2686,7 @@ static const char *did_set_winblend(optset_T *args) if (value != old_value) { win->w_p_winbl = MAX(MIN(win->w_p_winbl, 100), 0); win->w_hl_needs_update = true; - check_blending(curwin); + check_blending(win); } return NULL; -- cgit