Function: evil-execute-repeat-info-with-count

evil-execute-repeat-info-with-count is a byte-compiled function defined in evil-repeat.el.

Signature

(evil-execute-repeat-info-with-count COUNT REPEAT-INFO)

Documentation

Repeat the repeat-information REPEAT-INFO with the count of the first command replaced by COUNT. The count is replaced if and only if COUNT is non-nil.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-repeat.el
;; TODO: currently we prepend the replacing count before the
;; key-sequence that calls the command. Can we use direct
;; modification of prefix-arg instead? Does it work in
;; conjunction with `execute-kbd-macro'?
(defun evil-execute-repeat-info-with-count (count repeat-info)
  "Repeat the repeat-information REPEAT-INFO with the count of
the first command replaced by COUNT. The count is replaced if
and only if COUNT is non-nil."
  (evil-save-repeat-info
    (cond
     ;; do nothing (zero repeating)
     ((and count (zerop count)))
     ;; replace count
     (count
      (let ((evil-repeat-count count)
            done)
        (while (and repeat-info
                    (arrayp (car repeat-info))
                    (not done))
          (let* ((count-and-cmd (evil-extract-count (pop repeat-info))))
            (push (vconcat (number-to-string count)
                           (nth 2 count-and-cmd)
                           (nth 3 count-and-cmd))
                  repeat-info)
            (setq done t)))
        (evil-execute-repeat-info repeat-info)))
     ;; repeat with original count
     (t (evil-execute-repeat-info repeat-info)))))