view-search: Start search from beginning or end of line

* lisp/view.el (view-search): Go to beginning-of-line or end-of-line
instead of previous or next line before the search.  (Bug#76167)
This commit is contained in:
Tomas Nordin 2025-02-09 22:39:58 +01:00 committed by Stefan Kangas
parent c6fe5b7795
commit e35435daf3

View file

@ -885,7 +885,9 @@ for highlighting the match that is found."
(t (error "No previous View-mode search")))
(save-excursion
(if end (goto-char (if (< times 0) (point-max) (point-min)))
(forward-line (if (< times 0) -1 1)))
(if (< times 0)
(beginning-of-line)
(end-of-line)))
(if (if no (view-search-no-match-lines times regexp)
(re-search-forward regexp nil t times))
(setq where (point))))