aboutsummaryrefslogtreecommitdiff
path: root/pearl.el
diff options
context:
space:
mode:
Diffstat (limited to 'pearl.el')
-rw-r--r--pearl.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/pearl.el b/pearl.el
index 30249a6..78612a1 100644
--- a/pearl.el
+++ b/pearl.el
@@ -5208,10 +5208,16 @@ edit-then-merge flow keeps the user's expanded subtrees expanded."
(goto-char marker)
(if (pearl--subtree-has-local-edits-p)
(setq skipped (1+ skipped))
- (pearl--replace-issue-subtree-at-point issue)
- ;; `marker' still points at the new heading -- markers track
- ;; the buffer position across the replace's delete-then-insert.
- (push (copy-marker marker) touched-markers)
+ ;; Capture a type-nil marker at the heading start BEFORE the
+ ;; replace. The alist marker is type-t (it needs to advance
+ ;; past replaces of EARLIER subtrees so it stays on its own
+ ;; heading); a type-t marker on the CURRENT replace advances
+ ;; past its own delete-then-insert and lands on the next
+ ;; subtree. A type-nil copy stays anchored at the deletion
+ ;; start and ends up on the new heading after the re-insert.
+ (let ((touch (copy-marker marker nil)))
+ (pearl--replace-issue-subtree-at-point issue)
+ (push touch touched-markers))
(setq updated (1+ updated)))))))
;; Existing issues absent from the result: drop them, but keep dirty ones.
(dolist (cell existing)