aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-09-07 20:41:20 +0800
committerglepnir <glephunter@gmail.com>2024-09-10 13:31:42 +0800
commit8e81212e151a4e20cff33931b95279e14c4e21c2 (patch)
tree17cf0867333de5b2bc0dbeffbbd9039a770ee897 /src
parentb6e350a6b4df40fcc99931c460668c36fadc9989 (diff)
downloadrneovim-8e81212e151a4e20cff33931b95279e14c4e21c2.tar.gz
rneovim-8e81212e151a4e20cff33931b95279e14c4e21c2.tar.bz2
rneovim-8e81212e151a4e20cff33931b95279e14c4e21c2.zip
fix(highlight): floating windows inherit NormalFloat from global-ns
Problem: floating windows did not correctly inherit the NormalFloat highlight group from the global namespace when it was not defined in the window-specific namespace. This led to floating windows losing their background highlight when switching between namespaces. Solution: Updated the window highlight logic in update_window_hl() to handle the fallback. This fix resolves issues with floating window backgrounds not displaying as expected in certain namespace configurations.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/highlight.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c
index 8729c74ce8..b802eab4b9 100644
--- a/src/nvim/highlight.c
+++ b/src/nvim/highlight.c
@@ -370,12 +370,15 @@ void update_window_hl(win_T *wp, bool invalid)
// determine window specific background set in 'winhighlight'
bool float_win = wp->w_floating && !wp->w_config.external;
- if (float_win && hl_def[HLF_NFLOAT] != 0) {
+ if (float_win && hl_def[HLF_NFLOAT] != 0 && ns_id > 0) {
wp->w_hl_attr_normal = hl_def[HLF_NFLOAT];
} else if (hl_def[HLF_COUNT] > 0) {
wp->w_hl_attr_normal = hl_def[HLF_COUNT];
+ } else if (float_win) {
+ wp->w_hl_attr_normal = HL_ATTR(HLF_NFLOAT) > 0
+ ? HL_ATTR(HLF_NFLOAT) : highlight_attr[HLF_NFLOAT];
} else {
- wp->w_hl_attr_normal = float_win ? HL_ATTR(HLF_NFLOAT) : 0;
+ wp->w_hl_attr_normal = 0;
}
if (wp->w_floating) {