branch: elpa/anzu
commit d3650160d72cacd716dee4e626258b895bc1cc86
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>
Don't search if input regexp is not valid yet.
Input regexp may be invalid when users are inputting it.
---
anzu.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/anzu.el b/anzu.el
index 53a0278239..8b078e5dd9 100644
--- a/anzu.el
+++ b/anzu.el
@@ -355,13 +355,14 @@
(defun anzu--search-outside-visible (buf input beg end use-regexp)
(let ((searchfn (if use-regexp 're-search-forward 'search-forward)))
- (with-selected-window (get-buffer-window buf)
- (goto-char beg)
- (when (funcall searchfn input end t)
- (setq anzu--outside-point (match-beginning 0))
- (let ((overlay-limit (anzu--overlay-limit)))
- (anzu--count-and-highlight-matched buf input beg end use-regexp
- overlay-limit nil))))))
+ (when (or (not use-regexp) (anzu--validate-regexp input))
+ (with-selected-window (get-buffer-window buf)
+ (goto-char beg)
+ (when (funcall searchfn input end t)
+ (setq anzu--outside-point (match-beginning 0))
+ (let ((overlay-limit (anzu--overlay-limit)))
+ (anzu--count-and-highlight-matched buf input beg end use-regexp
+ overlay-limit nil)))))))
(defun anzu--check-minibuffer-input (buf beg end use-regexp overlay-limit)
(let* ((content (minibuffer-contents))