diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-25 05:00:48 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-25 05:00:48 -0500 |
| commit | 9b17dc89fc25417e207943dafe8bf09ac211ae32 (patch) | |
| tree | c92779db74b0a4cccc6e38d7307c781aa62e9356 /tests/test-pearl-keymap.el | |
| parent | 9f15d1823f388910f695da25ad5878312cc80330 (diff) | |
| download | pearl-9b17dc89fc25417e207943dafe8bf09ac211ae32.tar.gz pearl-9b17dc89fc25417e207943dafe8bf09ac211ae32.zip | |
feat: add pearl-delete-current-comment
Pearl could render, create, and edit comments but not delete one, so removing your own comment meant leaving Emacs for the web app. I added the delete command and filled the reserved C-; L d c keymap slot.
pearl-delete-current-comment runs from inside a comment's subtree. It's own-only, reusing the viewer gate from pearl-edit-current-comment: a comment authored by someone else, a bot, or an integration is refused with no commentDelete call. It confirms before the destructive mutation, and on success removes that comment's Org subtree, leaving sibling comments and the issue body untouched. pearl--delete-comment-async mirrors pearl--delete-issue-async.
The delete is permanent. I verified Linear's commentDelete against the live API: the comment is not found immediately after, with no restore path, so unlike issueDelete this isn't a recoverable soft delete. Because of that, a comment with unsaved local edits (or no stored hash) gets a stronger "discard your local edits" confirmation rather than the plain prompt.
I surfaced it as K in the transient Delete group and as d c in the prefix keymap, and inverted the keymap test that asserted d c was unbound.
Diffstat (limited to 'tests/test-pearl-keymap.el')
| -rw-r--r-- | tests/test-pearl-keymap.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test-pearl-keymap.el b/tests/test-pearl-keymap.el index 97d8440..260b6fa 100644 --- a/tests/test-pearl-keymap.el +++ b/tests/test-pearl-keymap.el @@ -66,9 +66,9 @@ Walks MAP looking for a labeled binding (\"label\" . COMMAND)." (should (keymapp (lookup-key pearl-prefix-map (kbd "n")))) (should (keymapp (lookup-key pearl-prefix-map (kbd "d"))))) -(ert-deftest test-pearl-prefix-map-no-delete-comment-yet () - "Delete-comment is not bound -- the command is a separate task." - (should-not (commandp (lookup-key pearl-prefix-map (kbd "d c"))))) +(ert-deftest test-pearl-prefix-map-delete-comment-bound () + "Delete-comment fills the d c slot under the delete prefix." + (should (eq 'pearl-delete-current-comment (lookup-key pearl-prefix-map (kbd "d c"))))) (ert-deftest test-pearl-prefix-map-not-bound-at-load () "Loading pearl does not bind the commands to any active key (opt-in)." |
