mirror of
https://github.com/m00natic/vlfi.git
synced 2025-02-24 05:48:06 +00:00
Return correct search success status.
This commit is contained in:
parent
ab20671a93
commit
c36db11b86
26
vlfi.el
26
vlfi.el
@ -319,14 +319,14 @@ OP-TYPE specifies the file operation being performed over FILENAME."
|
||||
vlfi-end-pos)))))
|
||||
(progress-reporter-done search-reporter))
|
||||
(if backward
|
||||
(vlfi-end-search match-end-pos match-start-pos
|
||||
(vlfi-goto-match match-end-pos match-start-pos
|
||||
count to-find)
|
||||
(vlfi-end-search match-start-pos match-end-pos
|
||||
(vlfi-goto-match match-start-pos match-end-pos
|
||||
count to-find)))))
|
||||
|
||||
(defun vlfi-end-search (match-pos-start match-pos-end count to-find)
|
||||
(defun vlfi-goto-match (match-pos-start match-pos-end count to-find)
|
||||
"Move to chunk surrounding MATCH-POS-START and MATCH-POS-END.
|
||||
According to COUNT and left TO-FIND show if search has been
|
||||
According to COUNT and left TO-FIND, show if search has been
|
||||
successful. Return nil if nothing found."
|
||||
(vlfi-move-to-batch (- match-pos-start (/ vlfi-batch-size 2)))
|
||||
(let* ((match-end (- match-pos-end vlfi-start-pos))
|
||||
@ -334,15 +334,15 @@ successful. Return nil if nothing found."
|
||||
match-end)))
|
||||
(overlay-put overlay 'face 'region)
|
||||
(goto-char match-end)
|
||||
(cond ((zerop to-find) t)
|
||||
((< to-find count)
|
||||
(message "Moved to the %d match which is last found"
|
||||
(- count to-find))
|
||||
t)
|
||||
(t (message "Not found")
|
||||
nil))
|
||||
(sit-for 0.1)
|
||||
(delete-overlay overlay)))
|
||||
(prog1 (cond ((zerop to-find) t)
|
||||
((< to-find count)
|
||||
(message "Moved to the %d match which is last found"
|
||||
(- count to-find))
|
||||
t)
|
||||
(t (message "Not found")
|
||||
nil))
|
||||
(sit-for 0.1)
|
||||
(delete-overlay overlay))))
|
||||
|
||||
(defun vlfi-re-search-forward (regexp count)
|
||||
"Search forward for REGEXP prefix COUNT number of times."
|
||||
|
Loading…
x
Reference in New Issue
Block a user