Function: magit-section-internal-region-p

magit-section-internal-region-p is a byte-compiled function defined in magit-section.el.

Signature

(magit-section-internal-region-p &optional SECTION)

Documentation

Return t if the region is active and inside SECTION's body.

If optional SECTION is nil, use the current section.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-section-20260330.1102/magit-section.el
(defun magit-section-internal-region-p (&optional section)
  "Return t if the region is active and inside SECTION's body.
If optional SECTION is nil, use the current section."
  (and (region-active-p)
       (or section (setq section (magit-current-section)))
       (let ((beg (magit-section-at (region-beginning))))
         (and (eq beg (magit-section-at (region-end)))
              (eq beg section)))
       (not (or (magit-section-position-in-heading-p section (region-beginning))
                (magit-section-position-in-heading-p section (region-end))))
       t))