Function: evil-ex-start-word-search
evil-ex-start-word-search is a byte-compiled function defined in
evil-search.el.
Signature
(evil-ex-start-word-search UNBOUNDED DIRECTION COUNT &optional SYMBOL)
Documentation
Search for the symbol under point.
The search matches the COUNT-th occurrence of the word. If the
UNBOUNDED argument is nil, the search matches only at symbol
boundaries, otherwise it matches anywhere. The DIRECTION
argument should be either forward or backward, determining
the search direction. If SYMBOL is non-nil then the functions
searches for the symbol at point, otherwise for the word at
point.
Source Code
;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-search.el
(defun evil-ex-start-word-search (unbounded direction count &optional symbol)
"Search for the symbol under point.
The search matches the COUNT-th occurrence of the word. If the
UNBOUNDED argument is nil, the search matches only at symbol
boundaries, otherwise it matches anywhere. The DIRECTION
argument should be either `forward' or `backward', determining
the search direction. If SYMBOL is non-nil then the functions
searches for the symbol at point, otherwise for the word at
point."
(let* ((string (or (evil-find-thing (eq direction 'forward)
(if symbol 'symbol 'word))
(user-error "No word under point")))
(regex (if unbounded
(regexp-quote string)
(format (if symbol "\\_<%s\\_>" "\\<%s\\>")
(regexp-quote string)))))
(setq evil-ex-search-count count
evil-ex-search-direction direction
evil-ex-search-pattern
(let (evil-ex-search-vim-style-regexp)
(evil-ex-make-search-pattern regex))
evil-ex-search-offset nil
evil-ex-last-was-search t)
;; update search history unless this pattern equals the
;; previous pattern
(unless (equal regex (car evil-ex-search-history))
(push regex evil-ex-search-history))
(evil-push-search-history regex (eq direction 'forward)))
(evil-ex-delete-hl 'evil-ex-search)
(evil-ex-search-next count))