Function: evil-forward-word

evil-forward-word is a byte-compiled function defined in evil-common.el.

Signature

(evil-forward-word &optional COUNT)

Documentation

Move by words.

Moves point COUNT words forward or (- COUNT) words backward if COUNT is negative. This function is the same as forward-word but returns the number of words by which point could *not* be moved.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-common.el
(defun evil-forward-word (&optional count)
  "Move by words.
Moves point COUNT words forward or (- COUNT) words backward if
COUNT is negative. This function is the same as `forward-word'
but returns the number of words by which point could *not* be
moved."
  (setq count (or count 1))
  (let* ((dir (if (>= count 0) +1 -1))
         (count (abs count)))
    (while (and (> count 0)
                (forward-word dir))
      (setq count (1- count)))
    count))