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.
This commit is contained in:
Barrett Ruth 2026-02-25 09:32:00 -05:00
parent b379b3cf13
commit baa5444a7e
2 changed files with 5 additions and 3 deletions

View file

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

View file

@ -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?