No description
Find a file
Barrett Ruth 0e0568769d
refactor: organize tests and dry (#49)
* refactor(store): convert singleton to Store.new() factory

Problem: store.lua used module-level _data singleton, making
project-local stores impossible and creating hidden global state.

Solution: introduce Store metatable with all operations as instance
methods. M.new(path) constructs an instance; M.resolve_path()
searches upward for .pending.json and falls back to
config.get().data_path. Singleton module API is removed.

* refactor(diff): accept store instance as parameter

Problem: diff.apply called store singleton methods directly, coupling
it to global state and preventing use with project-local stores.

Solution: change signature to apply(lines, s, hidden_ids?) where s is
a pending.Store instance. All store operations now go through s.

* refactor(buffer): add set_store/store accessors, drop singleton dep

Problem: buffer.lua imported store directly and called singleton
methods, preventing it from working with per-project store instances.

Solution: add module-level _store, M.set_store(s), and M.store()
accessors. open() and render() use _store instead of the singleton.
init.lua will call buffer.set_store(s) before buffer.open().

* refactor(complete,health,sync,plugin): update callers to store instance API

Problem: complete.lua, health.lua, sync/gcal.lua, and plugin/pending.lua
all called singleton store methods directly.

Solution: complete.lua uses buffer.store() for category lookups;
health.lua uses store.new(store.resolve_path()) and reports the
resolved path; gcal.lua calls require('pending').store() for task
access; plugin tab-completion creates ephemeral store instances via
store.new(store.resolve_path()). Add 'init' to the subcommands list.

* feat(init): thread Store instance through init, add :Pending init

Problem: init.lua called singleton store methods throughout, and there
was no way to create a project-local .pending.json file.

Solution: add module-level _store and private get_store() that
lazy-constructs via store.new(store.resolve_path()). Add public
M.store() accessor used by specs and sync backends. M.open() calls
buffer.set_store(get_store()) before buffer.open(). All store
callsites converted to get_store():method(). goto_file() and
add_here() derive the data directory from get_store().path.

Add M.init() which creates .pending.json in cwd and dispatches from
M.command() as ':Pending init'.

* test: update all specs for Store instance API

Problem: every spec used the old singleton API (store.unload(),
store.load(), store.add(), etc.) and diff.apply(lines, hidden).

Solution: lower-level specs (store, diff, views, complete, file) use
s = store.new(path); s:load() directly. Higher-level specs (archive,
edit, filter, status, sync) reset package.loaded['pending'] in
before_each and use pending.store() to access the live instance.
diff.apply calls updated to diff.apply(lines, s, hidden_ids).

* docs(pending): document :Pending init and store resolution

Add *pending-store-resolution* section explaining upward .pending.json
discovery and fallback to the global data_path. Document :Pending init
under COMMANDS. Add a cross-reference from the data_path config field.

* ci: format

* ci: remove unused variable
2026-02-26 20:03:42 -05:00
.github doc: minify readme (#24) 2026-02-25 09:40:06 -05:00
assets feat(customization): icons config, PendingTab, and demo infrastructure (#46) 2026-02-26 19:20:29 -05:00
doc refactor: organize tests and dry (#49) 2026-02-26 20:03:42 -05:00
lua/pending refactor: organize tests and dry (#49) 2026-02-26 20:03:42 -05:00
plugin refactor: organize tests and dry (#49) 2026-02-26 20:03:42 -05:00
scripts feat(customization): icons config, PendingTab, and demo infrastructure (#46) 2026-02-26 19:20:29 -05:00
spec refactor: organize tests and dry (#49) 2026-02-26 20:03:42 -05:00
syntax refactor: adopt markdown-style checkbox buffer format (#20) 2026-02-24 23:21:55 -05:00
.busted build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
.editorconfig build: initial repo scaffold 2026-02-24 15:08:35 -05:00
.gitignore build: initial repo scaffold 2026-02-24 15:08:35 -05:00
.luarc.json build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
.pre-commit-config.yaml ci: format 2026-02-24 15:17:24 -05:00
flake.lock build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
flake.nix build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
LICENSE build: initial repo scaffold 2026-02-24 15:08:35 -05:00
pending.nvim-scm-1.rockspec feat: rename 2026-02-24 15:21:44 -05:00
README.md feat(customization): icons config, PendingTab, and demo infrastructure (#46) 2026-02-26 19:20:29 -05:00
selene.toml build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
stylua.toml build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00
vim.yaml build: add tooling and dev environment configs 2026-02-24 15:08:44 -05:00

pending.nvim

Edit tasks like text. :w saves them.

demo

Requirements

  • Neovim 0.10+
  • (Optionally) curl and openssl for Google Calendar and Google Task sync

Installation

Install with your package manager of choice or via luarocks:

luarocks install pending.nvim

Documentation

:help pending.nvim

Icons

pending.nvim renders task status and metadata using configurable icon characters. The defaults use plain unicode (no nerd font required):

vim.g.pending = {
  icons = {
    pending = '○', done = '✓', priority = '●',
    header = '▸', due = '·', recur = '↺', category = '#',
  },
}

See :help pending.Icons for nerd font examples.

Acknowledgements