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")