Skip to content

Commit

Permalink
magit-insert-section--finish: Fix collecting children
Browse files Browse the repository at this point in the history
Children are being pushed to the `children' slot of the object,
not the `children' variable that was added in [1: 4ec4d02].

1: 2024-05-04 4ec4d02
   magit-insert-section--finish: Optimize propertizing leaf sections
  • Loading branch information
tarsius committed May 7, 2024
1 parent b6c9286 commit 3695493
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lisp/magit-section.el
Original file line number Diff line number Diff line change
Expand Up @@ -1446,12 +1446,11 @@ anything this time around.
(point-marker))))
(props `( magit-section ,obj
,@(and-let* ((map (symbol-value (oref obj keymap))))
(list 'keymap map))))
(children (oref obj children)))
(list 'keymap map)))))
(unless magit-section-inhibit-markers
(set-marker-insertion-type beg t))
(cond ((eq obj magit-root-section))
(children
((oref obj children)
(magit-insert-child-count obj)
(magit-section-maybe-add-heading-map obj)
(save-excursion
Expand Down Expand Up @@ -1479,7 +1478,7 @@ anything this time around.
(nconc (oref parent children)
(list obj))))))
(when magit-section-insert-in-reverse
(oset obj children (nreverse children)))))
(oset obj children (nreverse (oref obj children))))))

(defun magit-cancel-section (&optional if-empty)
"Cancel inserting the section that is currently being inserted.
Expand Down

0 comments on commit 3695493

Please sign in to comment.