aboutsummaryrefslogtreecommitdiff
path: root/src/nvim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim')
-rw-r--r--src/nvim/highlight.c7
-rw-r--r--src/nvim/highlight_defs.h2
-rw-r--r--src/nvim/syntax.c1
-rw-r--r--src/nvim/window.c9
4 files changed, 18 insertions, 1 deletions
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c
index 4c5fca6d39..3ba02be32d 100644
--- a/src/nvim/highlight.c
+++ b/src/nvim/highlight.c
@@ -160,14 +160,19 @@ void update_window_hl(win_T *wp, bool invalid)
wp->w_hl_needs_update = false;
// determine window specific background set in 'winhighlight'
+ bool float_win = wp->w_floating && !wp->w_float_config.external;
if (wp != curwin && wp->w_hl_ids[HLF_INACTIVE] > 0) {
wp->w_hl_attr_normal = hl_get_ui_attr(HLF_INACTIVE,
wp->w_hl_ids[HLF_INACTIVE], true);
+ } else if (float_win && wp->w_hl_ids[HLF_NFLOAT] > 0) {
+ wp->w_hl_attr_normal = hl_get_ui_attr(HLF_NFLOAT,
+ wp->w_hl_ids[HLF_NFLOAT], true);
} else if (wp->w_hl_id_normal > 0) {
wp->w_hl_attr_normal = hl_get_ui_attr(-1, wp->w_hl_id_normal, true);
} else {
- wp->w_hl_attr_normal = 0;
+ wp->w_hl_attr_normal = float_win ? HL_ATTR(HLF_NFLOAT) : 0;
}
+
if (wp != curwin) {
wp->w_hl_attr_normal = hl_combine_attr(HL_ATTR(HLF_INACTIVE),
wp->w_hl_attr_normal);
diff --git a/src/nvim/highlight_defs.h b/src/nvim/highlight_defs.h
index 1da33bfea5..746d2c2dfc 100644
--- a/src/nvim/highlight_defs.h
+++ b/src/nvim/highlight_defs.h
@@ -90,6 +90,7 @@ typedef enum {
, HLF_0 // Whitespace
, HLF_INACTIVE // NormalNC: Normal text in non-current windows
, HLF_MSGSEP // message separator line
+ , HLF_NFLOAT // Floating window
, HLF_COUNT // MUST be the last one
} hlf_T;
@@ -142,6 +143,7 @@ EXTERN const char *hlf_names[] INIT(= {
[HLF_0] = "Whitespace",
[HLF_INACTIVE] = "NormalNC",
[HLF_MSGSEP] = "MsgSeparator",
+ [HLF_NFLOAT] = "NormalFloat",
});
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 0104f0d834..8c3ce823d3 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -5956,6 +5956,7 @@ static const char *highlight_init_both[] = {
"default link Substitute Search",
"default link Whitespace NonText",
"default link MsgSeparator StatusLine",
+ "default link NormalFloat Pmenu",
NULL
};
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 25e6bfc565..edb5b06a2e 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -567,6 +567,10 @@ win_T *win_new_float(win_T *wp, int width, int height, FloatConfig config,
wp->w_floating = 1;
wp->w_status_height = 0;
wp->w_vsep_width = 0;
+
+ // TODO(bfredl): use set_option_to() after merging #9110 ?
+ wp->w_p_nu = false;
+ wp->w_allbuf_opt.wo_nu = false;
win_config_float(wp, width, height, config);
wp->w_pos_changed = true;
redraw_win_later(wp, VALID);
@@ -586,6 +590,7 @@ void win_config_float(win_T *wp, int width, int height,
config.window = curwin->handle;
}
+ bool change_external = config.external != wp->w_float_config.external;
wp->w_float_config = config;
if (!ui_has(kUIMultigrid)) {
@@ -596,6 +601,10 @@ void win_config_float(win_T *wp, int width, int height,
win_set_inner_size(wp);
must_redraw = MAX(must_redraw, VALID);
wp->w_pos_changed = true;
+ if (change_external) {
+ wp->w_hl_needs_update = true;
+ redraw_win_later(wp, NOT_VALID);
+ }
}
static void ui_ext_win_position(win_T *wp)