From 766cfc0f8fbfc9af398faf15c17ba34b92fb3dad Mon Sep 17 00:00:00 2001 From: The_miro Date: Tue, 26 May 2026 12:08:20 +0200 Subject: [PATCH] fix(nvim): fix black float backgrounds and guarantee abook 24-line height - Add winhighlight=Normal:Normal to all floats so they inherit the colorscheme background instead of showing NormalFloat (black) - Pin abook to min 24 lines; mail/calendar split the remaining height Co-Authored-By: Claude Sonnet 4.6 --- nvim/init.lua | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index c635292..2bb87b7 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -179,14 +179,15 @@ end local function _pim_float(row, col, height, width, border) local buf = vim.api.nvim_create_buf(false, true) vim.api.nvim_open_win(buf, true, { - relative = "editor", - row = row, - col = col, - height = math.max(1, height), - width = math.max(1, width), - style = "minimal", - border = border or "none", - zindex = 50, + relative = "editor", + row = row, + col = col, + height = math.max(1, height), + width = math.max(1, width), + style = "minimal", + border = border or "none", + zindex = 50, + winhighlight = "Normal:Normal,NormalNC:Normal", }) return vim.api.nvim_get_current_win() end @@ -232,10 +233,11 @@ local function toggle_pim() local H = vim.o.lines - 2 local col_w = math.min(vim.o.columns, math.max(90, math.floor(vim.o.columns * 0.45))) - -- divide column height: mail 40%, calendar 30%, abook remainder (≥ 10) - local mail_h = math.max(1, math.floor(H * 0.40)) - local cal_h = math.max(1, math.floor(H * 0.30)) - local ab_h = math.max(1, H - mail_h - cal_h) + -- abook gets a fixed 24-line minimum; mail/calendar split the rest 57/43 + local ab_h = math.max(24, math.floor(H * 0.30)) + local rest = math.max(2, H - ab_h) + local mail_h = math.max(1, math.floor(rest * 0.57)) + local cal_h = math.max(1, rest - mail_h) local w1 = _pim_float(0, 0, mail_h, col_w) local ok, err = pcall(vim.cmd, "terminal alot")