branch: elpa/anzu
commit 169cf556741d4d54c3ea090aa80173b0fb754a38
Author: Syohei YOSHIDA <[email protected]>
Commit: Syohei YOSHIDA <[email protected]>

    Use previous result if regexp validation is failed
    
    Original code generates error message if regexp validation is failed.
    Because result is set nil. So if the validation is failed, anzu use
    previous result.
---
 anzu.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/anzu.el b/anzu.el
index 2ad8b0b08a..0010128a5b 100644
--- a/anzu.el
+++ b/anzu.el
@@ -108,7 +108,8 @@
   (when (and (not (memq anzu--last-command anzu-regexp-search-commands))
              (not isearch-regexp))
     (setq str (regexp-quote str)))
-  (when (anzu--validate-regexp str)
+  (if (not (anzu--validate-regexp str))
+      anzu--cached-positions      
     (save-excursion
       (goto-char (point-min))
       (let ((positions '())

Reply via email to