Function: evil-visual-direction

evil-visual-direction is a byte-compiled function defined in evil-states.el.

Signature

(evil-visual-direction)

Documentation

Return direction of Visual selection.

The direction is -1 if point precedes mark and 1 otherwise. See also the variable evil-visual-direction(var)/evil-visual-direction(fun), which holds the direction of the last selection.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-states.el
(defun evil-visual-direction ()
  "Return direction of Visual selection.
The direction is -1 if point precedes mark and 1 otherwise.
See also the variable `evil-visual-direction', which holds
the direction of the last selection."
  (let* ((point (point))
         (mark (or (mark t) point)))
    (if (< point mark) -1 1)))