fix(nvim): guarantee abook/calendar column is at least 80 cols wide

Right column was derived as W - left_w, making it too narrow on smaller
terminals. Now right_w = max(80, 45% of W) and left_w takes the rest.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
Amir Alexander Abdelbaki 2026-05-26 13:39:04 +02:00
parent 50c5b72683
commit c2514b6fb5
1 changed files with 2 additions and 2 deletions

View File

@ -248,8 +248,8 @@ local function toggle_pim()
-- full-screen: alot left, abook top-right, calendar bottom-right -- full-screen: alot left, abook top-right, calendar bottom-right
local H = vim.o.lines - 2 local H = vim.o.lines - 2
local W = vim.o.columns local W = vim.o.columns
local left_w = math.max(1, math.floor(W * 0.55)) local right_w = math.max(80, math.floor(W * 0.45))
local right_w = math.max(1, W - left_w) local left_w = math.max(1, W - right_w)
local top_h = math.max(1, math.floor(H / 2)) local top_h = math.max(1, math.floor(H / 2))
local bot_h = math.max(1, H - top_h) local bot_h = math.max(1, H - top_h)