Function: evil-range-union

evil-range-union is a byte-compiled function defined in evil-common.el.

Signature

(evil-range-union RANGE1 RANGE2 &optional TYPE)

Documentation

Return the union of the ranges RANGE1 and RANGE2.

If the ranges have conflicting types, use RANGE1's type. This can be overridden with TYPE.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-common.el
(defun evil-range-union (range1 range2 &optional type)
  "Return the union of the ranges RANGE1 and RANGE2.
If the ranges have conflicting types, use RANGE1's type.
This can be overridden with TYPE."
  (when (and (evil-range-p range1)
             (evil-range-p range2))
    (evil-range (min (evil-range-beginning range1)
                     (evil-range-beginning range2))
                (max (evil-range-end range1)
                     (evil-range-end range2))
                (or type
                    (evil-type range1)
                    (evil-type range2)))))