Function: evil-count-lines

evil-count-lines is a byte-compiled function defined in evil-common.el.

Signature

(evil-count-lines BEG END)

Documentation

Return absolute line-number-difference betweeen BEG and END.

This should give the same results no matter where on the line BEG and END are.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-common.el
(defun evil-count-lines (beg end)
  "Return absolute line-number-difference betweeen BEG and END.
This should give the same results no matter where on the line BEG
and END are."
  (if (= beg end)
      0
    (let ((end-at-bol (save-excursion (goto-char (max beg end))
                                      (bolp))))
      (if end-at-bol
          (count-lines beg end)
        (1- (count-lines beg end))))))