Function: evil-ex-search-update

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

Signature

(evil-ex-search-update PATTERN OFFSET BEG END)

Documentation

Update the highlighting for the search pattern.

PATTERN is the search pattern and OFFSET the associated offset. BEG and END specify the current match.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-search.el
(defun evil-ex-search-update (pattern offset beg end)
  "Update the highlighting for the search pattern.
PATTERN is the search pattern and OFFSET the associated offset.
BEG and END specify the current match."
  (cond
   ((and beg end)
    ;; update overlay
    (if evil-ex-search-overlay
        (move-overlay evil-ex-search-overlay beg end)
      (setq evil-ex-search-overlay (make-overlay beg end))
      (overlay-put evil-ex-search-overlay 'priority 1001)
      (overlay-put evil-ex-search-overlay 'face 'evil-ex-search))
    ;; move point
    (goto-char beg)
    (evil-ex-search-goto-offset offset)
    ;; update highlights
    (when evil-ex-search-highlight-all
      (evil-ex-hl-change 'evil-ex-search pattern)))
   (t
    ;; no match
    (when evil-ex-search-overlay
      ;; remove overlay
      (delete-overlay evil-ex-search-overlay)
      (setq evil-ex-search-overlay nil))
    ;; no highlights
    (when evil-ex-search-highlight-all
      (evil-ex-hl-change 'evil-ex-search nil))
    ;; and go to initial position
    (goto-char evil-ex-search-start-point))))