Function: evil-repeat-ex-search

evil-repeat-ex-search is a byte-compiled function defined in evil-commands.el.

Signature

(evil-repeat-ex-search FLAG)

Documentation

Called to record a search command.

FLAG is either pre or post if the function is called before resp. after executing the command.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(defun evil-repeat-ex-search (flag)
  "Called to record a search command.
FLAG is either `pre' or `post' if the function is called before resp.
after executing the command."
  (cond
   ((and (evil-operator-state-p) (eq flag 'pre))
    (evil-repeat-record (this-command-keys))
    (evil-clear-command-keys))
   ((and (evil-operator-state-p) (eq flag 'post))
    (let ((search-separator (car (last evil-repeat-info))))
      (evil-repeat-record (evil-ex-pattern-regex evil-ex-search-pattern))
      (when evil-ex-search-offset
        (evil-repeat-record (concat search-separator evil-ex-search-offset))))
    ;; If it weren't for the fact that `exit-minibuffer' throws an `exit'
    ;; tag, which bypasses the source of `this-command-keys', we'd be able
    ;; to capture the key(s) in the post-command of the operator as usual.
    ;; Fortunately however, `last-input-event' can see the key (by default, `return')
    (when (zerop (length (this-command-keys)))
      (evil-repeat-record (vector last-input-event))))
   (t (evil-repeat-motion flag))))