Skip to content

Feature/undo delete#2

Merged
alexesba merged 4 commits into
mainfrom
feature/undo-delete
Jun 10, 2026
Merged

Feature/undo delete#2
alexesba merged 4 commits into
mainfrom
feature/undo-delete

Conversation

@alexesba

@alexesba alexesba commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Adds undo for deletes so removing a task (or a bulk selection) is no longer
irreversible. Press u in the pad to restore the most recently deleted task(s)
to their original positions.

  • Single & bulk undo — works for dd and visual-mode V + d. Removed
    tasks are recorded with their original indices and re-inserted in place.
  • Sequential, one transaction at a time — each delete is its own undo step;
    repeated u walks back through the history.
  • Bounded & in-memory — the undo stack is capped at 25 entries and is not
    persisted across sessions (keeps behavior simple and predictable).
  • Configurable mappingmappings.undo (default u), set to false to
    disable.
  • Notifies Restored N task(s) or Nothing to undo.

Changes

  • store.lua: record deletions (single + bulk) onto a bounded undo stack; add
    store.undo() that restores the most recent deletion.
  • actions.lua: actions.undo() with notifications; bound to the new
    mappings.undo key in the pad.
  • config.lua: new mappings.undo = "u" (typed in PinPadMappings).
  • Docs: README feature list, mappings table, and config block; SPEC mappings
    table.
  • Tests: tests/undo_spec.lua covering single/bulk restore-to-position,
    empty-stack, the 25-deep cap, and sequential undo.

Test plan

  • make test green locally (18 passed, 0 failed)
  • CI runs the suite on Neovim stable + nightly
  • Manual: delete a task with dd, press u, confirm it returns to its spot
  • Manual: V select several tasks, d to bulk-delete, u restores all
  • Manual: press u with nothing to undo → "Nothing to undo"

alexesbafh and others added 4 commits June 9, 2026 18:49
Single and bulk deletes now push the removed tasks (with their original
positions) onto a bounded undo stack. store.undo() restores the most
recent deletion in place. No-op when the stack is empty.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds actions.undo() with a restored/nothing-to-undo notification, the
configurable mappings.undo key (default `u`), and binds it in the pad.

Co-authored-by: Cursor <cursoragent@cursor.com>
Adds the `u` mapping to the README feature list, mappings table, and
config block, and to the SPEC in-buffer mappings table.

Co-authored-by: Cursor <cursoragent@cursor.com>
undo_spec.lua exercises restore-to-position for single and bulk
deletes, empty-stack, the 25-deep cap, and one-transaction-at-a-time
sequential undo.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alexesba alexesba merged commit 468676d into main Jun 10, 2026
4 checks passed
@alexesba alexesba deleted the feature/undo-delete branch June 10, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants