]> code.delx.au - gnu-emacs-elpa/commitdiff
Don't error on bad regex
authorOleh Krehel <ohwoeowho@gmail.com>
Thu, 30 Apr 2015 06:42:01 +0000 (08:42 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Thu, 30 Apr 2015 06:42:01 +0000 (08:42 +0200)
* ivy.el (ivy--filter): When on bad regex, just set the result to nil.

Fixes #70

ivy.el

diff --git a/ivy.el b/ivy.el
index ffc1913dad444c4a922e569b4715754118593b9a..e0adecdd4fdbdecca3fa9031e72025a5903525b2 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -890,12 +890,13 @@ CANDIDATES are assumed to be static."
                              (res candidates))
                          (dolist (re re-list)
                            (setq res
-                                 (funcall
-                                  (if (cdr re)
-                                      #'cl-remove-if-not
-                                    #'cl-remove-if)
-                                  `(lambda (x) (string-match ,(car re) x))
-                                  res)))
+                                 (ignore-errors
+                                   (funcall
+                                    (if (cdr re)
+                                        #'cl-remove-if-not
+                                      #'cl-remove-if)
+                                    `(lambda (x) (string-match ,(car re) x))
+                                    res))))
                          res))))
          (tail (nthcdr ivy--index ivy--old-cands))
          idx)