Function: magit-insert-section--finish

magit-insert-section--finish is a byte-compiled function defined in magit-section.el.

Signature

(magit-insert-section--finish OBJ)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-section-20260330.1102/magit-section.el
(defun magit-insert-section--finish (obj)
  (run-hooks 'magit-insert-section-hook)
  (if magit-section-inhibit-markers
      (oset obj end (point))
    (oset obj end (point-marker))
    (set-marker-insertion-type (oref obj start) t))
  (cond
    ((eq obj magit-root-section)
     (when (eq magit-section-inhibit-markers 'delay)
       (setq magit-section-inhibit-markers nil)
       (magit-map-sections
        (lambda (section)
          (oset section start (copy-marker (oref section start) t))
          (oset section end   (copy-marker (oref section end)   t))))))
    (t
     (magit-section--set-section-properties obj)
     (magit-section-maybe-add-heading-map obj)
     (when (oref obj children)
       (magit-insert-child-count obj))
     (if magit-section-insert-in-reverse
         (push obj (oref (oref obj parent) children))
       (let ((parent (oref obj parent)))
         (oset parent children
               (nconc (oref parent children)
                      (list obj)))))))
  (when magit-section-insert-in-reverse
    (oset obj children (nreverse (oref obj children)))))