pending.nvim/lua/pending
Barrett Ruth a38be10e67
fix(buffer): correct extmark drift on open_line for done tasks (#118)
* fix(config): update default keymaps to match vimdoc

Problem: four keymap defaults in `config.lua` still used the old
deprecated keys (`!`, `D`, `U`, `F`) while `doc/pending.txt` documents
the `g`-prefixed replacements (`g!`, `gd`, `gz`, `gf`).

Solution: update `priority`, `date`, `undo`, and `filter` defaults to
`g!`, `gd`, `gz`, and `gf` respectively.

* fix(buffer): correct extmark drift on `open_line` above/below done tasks

Problem: `open_line` used `nvim_buf_set_lines` which triggered `on_bytes`
with a `start_row` offset designed for native `o`/`O` keypresses. The
`_meta` entry was inserted one position too late, causing the done task's
`PendingDone` highlight to attach to the new blank line instead.

Solution: suppress `on_bytes` during `open_line` by reusing the
`_rendering` guard, insert the meta entry at the correct position, and
immediately reapply inline extmarks for the affected rows.

* fix(buffer): infer task status from line text in `reapply_dirty_inline`

Problem: `on_bytes` inserts bare `{ type = 'task' }` meta entries with
no `status` field for any new lines (paste, undo, native edits). When
meta positions also shift incorrectly (e.g. `P` paste above), existing
meta with the wrong status ends up on the wrong row. This causes done
tasks to lose their `PendingDone` highlight and pending tasks to appear
greyed out.

Solution: always re-infer `status` from the actual buffer line text for
dirty task rows before applying extmarks. The checkbox character (`[x]`,
`[>]`, `[=]`, `[ ]`) is the source of truth, with fallback to the
existing meta status if the line doesn't match a task pattern.
2026-03-09 00:28:58 -04:00
..
sync fix(sync): normalize log prefixes and S3 prompt UX (#115) 2026-03-08 20:56:22 -04:00
buffer.lua fix(buffer): correct extmark drift on open_line for done tasks (#118) 2026-03-09 00:28:58 -04:00
complete.lua refactor(types): extract inline anonymous types into named classes (#110) 2026-03-08 19:49:49 -04:00
config.lua fix(config): update default keymaps to match vimdoc (#116) 2026-03-09 00:10:09 -04:00
diff.lua feat: complete task editing coverage (#109) 2026-03-08 19:44:03 -04:00
health.lua fix(diff): preserve due/rec when absent from buffer line (#68) 2026-03-05 12:46:54 -05:00
init.lua feat: add <C-a> / <C-x> keymaps for priority increment/decrement (#114) 2026-03-08 20:49:05 -04:00
log.lua fix(diff): preserve due/rec when absent from buffer line (#68) 2026-03-05 12:46:54 -05:00
parse.lua feat: add <C-a> / <C-x> keymaps for priority increment/decrement (#114) 2026-03-08 20:49:05 -04:00
recur.lua feat: time-aware due dates, persistent undo, @return audit (#33) 2026-02-25 20:37:50 -05:00
store.lua refactor(types): extract inline anonymous types into named classes (#110) 2026-03-08 19:49:49 -04:00
textobj.lua fix(diff): preserve due/rec when absent from buffer line (#68) 2026-03-05 12:46:54 -05:00
views.lua feat: auth backend (#111) 2026-03-08 19:53:42 -04:00