From a668986da0656a9980fb59b8aa9a017750b8bdd7 Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Tue, 10 Mar 2026 23:18:20 -0400 Subject: [PATCH] refactor(forge): rename `auto_close` to `close` (#137) Problem: `auto_close` is verbose given it's already namespaced under `forge.` in the config table. Solution: Rename to `close` in config defaults, class annotation, `refresh()` usage, and vimdoc. --- doc/pending.txt | 6 +++--- lua/pending/config.lua | 4 ++-- lua/pending/forge.lua | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/pending.txt b/doc/pending.txt index 9195c76..3078ea9 100644 --- a/doc/pending.txt +++ b/doc/pending.txt @@ -1500,7 +1500,7 @@ Configuration: ~ >lua vim.g.pending = { forge = { - auto_close = false, + close = false, warn_missing_cli = true, github = { icon = '', @@ -1522,7 +1522,7 @@ Configuration: ~ < Top-level fields: ~ - {auto_close} (boolean, default: false) When true, tasks linked to + {close} (boolean, default: false) When true, tasks linked to closed/merged remote issues are automatically marked done on buffer open. {warn_missing_cli} (boolean, default: true) When true, warns once per @@ -1550,7 +1550,7 @@ than 5 minutes are re-fetched asynchronously. The buffer renders immediately with cached data and updates extmarks when the fetch completes. State pull: ~ -Requires `forge.auto_close = true`. After fetching, if the remote issue/PR +Requires `forge.close = true`. After fetching, if the remote issue/PR is closed or merged and the local task is pending/wip/blocked, the task is automatically marked as done. Disabled by default. One-way: local status changes do not push back to the forge. diff --git a/lua/pending/config.lua b/lua/pending/config.lua index 5a139cb..60775fe 100644 --- a/lua/pending/config.lua +++ b/lua/pending/config.lua @@ -40,7 +40,7 @@ ---@field shorthand? string ---@class pending.ForgeConfig ----@field auto_close? boolean +---@field close? boolean ---@field warn_missing_cli? boolean ---@field [string] pending.ForgeInstanceConfig @@ -154,7 +154,7 @@ local defaults = { }, sync = {}, forge = { - auto_close = false, + close = false, warn_missing_cli = true, github = { icon = '', diff --git a/lua/pending/forge.lua b/lua/pending/forge.lua index baebc0a..43150c0 100644 --- a/lua/pending/forge.lua +++ b/lua/pending/forge.lua @@ -310,7 +310,7 @@ function M.refresh(s) any_fetched = true local forge_cfg = config.get().forge or {} if - forge_cfg.auto_close + forge_cfg.close and (cache.state == 'closed' or cache.state == 'merged') and (task.status == 'pending' or task.status == 'wip' or task.status == 'blocked') then