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; diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index f9849ea7fa..c9f28f430a 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -1017,7 +1017,7 @@ describe('float window', function() {1: }| {2:~ }| ]], float_pos={ - [5] = {{id = 1002}, "NW", 4, 2, 10, true, 50}; + [5] = {{id = 1002}, "NW", 4, 2, 10, true}; }} else screen:expect([[ @@ -9191,6 +9191,13 @@ describe('float window', function() [13] = {background = Screen.colors.LightGray, blend = 30}, [14] = {foreground = Screen.colors.Grey0, background = Screen.colors.Grey88}, [15] = {foreground = tonumber('0x939393'), background = Screen.colors.Grey88}, + [16] = {background = Screen.colors.Grey90}; + [17] = {blend = 100}; + [18] = {background = Screen.colors.LightMagenta, blend = 100}; + [19] = {background = Screen.colors.LightMagenta, bold = true, blend = 100, foreground = Screen.colors.Blue1}; + [20] = {background = Screen.colors.White, foreground = Screen.colors.Gray0}; + [21] = {background = Screen.colors.White, bold = true, foreground = tonumber('0x00007f')}; + [22] = {background = Screen.colors.Gray90, foreground = Screen.colors.Gray0}; }) insert([[ Lorem ipsum dolor sit amet, consectetur @@ -9321,9 +9328,7 @@ describe('float window', function() {13:test }| {13: }| {13:popup text }| - ]], float_pos={ - [4] = {{id = 1001}, "NW", 1, 2, 5, true, 50}; - }} + ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} else screen:expect([[ Ut enim ad minim veniam, quis nostrud | @@ -9477,6 +9482,56 @@ describe('float window', function() | ]]) end + + -- Check that 'winblend' applies to border + meths.win_set_config(win, {border='single'}) + meths.set_option_value('winblend', 100, {win=win.id}) + meths.set_option_value("cursorline", true, {win=0}) + command('hi clear VertSplit') + feed('k0') + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [2:--------------------------------------------------]| + [3:--------------------------------------------------]| + ## grid 2 + Ut enim ad minim veniam, quis nostrud | + exercitation ullamco laboris nisi ut aliquip ex | + ea commodo consequat. Duis aute irure dolor in | + reprehenderit in voluptate velit esse cillum | + dolore eu fugiat nulla pariatur. Excepteur sint | + occaecat cupidatat non proident, sunt in culpa | + {16:^qui officia deserunt mollit anim id est }| + laborum. | + ## grid 3 + | + ## grid 4 + {17:┌───────────────┐}| + {17:│}{11:popup text}{18: }{17:│}| + {17:│}{19:~ }{17:│}| + {17:│}{19:~ }{17:│}| + {17:└───────────────┘}| + ]], float_pos={[4] = {{id = 1001}, "NW", 1, 2, 5, true}}} + else + screen:expect([[ + Ut enim ad minim veniam, quis nostrud | + exercitation ullamco laboris nisi ut aliquip ex | + ea co{20:┌───────────────┐}Duis aute irure dolor in | + repre{20:│}{5:popup}{6:it i}{5:text}{20:lu│}tate velit esse cillum | + dolor{20:│}{21:~}{20:eu fugiat null│} pariatur. Excepteur sint | + occae{20:│}{21:~}{20:t cupidatat no│} proident, sunt in culpa | + {16:^qui o}{22:└───────────────┘}{16:ollit anim id est }| + laborum. | + | + ]]) + end end) it('can overlap doublewidth chars', function()