From baa5444a7e6cceef8d40599017012d9e05cacfd0 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Wed, 25 Feb 2026 09:32:00 -0500 Subject: [PATCH] fix(buffer): default to natural split height like fugitive Problem: hardcoded drawer_height=15 was too small and diverged from fugitive's model. Fugitive issues a plain botright split and lets Vim's own split rules (equalalways, winheight) divide the available space. Solution: remove the default height so the split sizes naturally. Only call nvim_win_set_height when the user sets drawer_height to a positive value, preserving the opt-in customization path. --- lua/pending/buffer.lua | 5 ++++- lua/pending/config.lua | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/pending/buffer.lua b/lua/pending/buffer.lua index 1dc4e9d..d11254b 100644 --- a/lua/pending/buffer.lua +++ b/lua/pending/buffer.lua @@ -284,7 +284,10 @@ function M.open() vim.cmd('botright new') task_winid = vim.api.nvim_get_current_win() vim.api.nvim_win_set_buf(task_winid, task_bufnr) - vim.api.nvim_win_set_height(task_winid, config.get().drawer_height) + local h = config.get().drawer_height + if h and h > 0 then + vim.api.nvim_win_set_height(task_winid, h) + end set_win_options(task_winid) M.render(task_bufnr) diff --git a/lua/pending/config.lua b/lua/pending/config.lua index 5997994..b61f44a 100644 --- a/lua/pending/config.lua +++ b/lua/pending/config.lua @@ -9,7 +9,7 @@ ---@field date_format string ---@field date_syntax string ---@field category_order? string[] ----@field drawer_height integer +---@field drawer_height? integer ---@field gcal? pending.GcalConfig ---@class pending.config @@ -23,7 +23,6 @@ local defaults = { date_format = '%b %d', date_syntax = 'due', category_order = {}, - drawer_height = 15, } ---@type pending.Config?