branch: master
commit 4a810a6ffdc25630cf438429250bf5aa08d2ac35
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    Add an optimization to speed up matching
    
    * ivy.el (ivy-completions): Update.
---
 ivy.el |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/ivy.el b/ivy.el
index 6717cf6..e9da976 100644
--- a/ivy.el
+++ b/ivy.el
@@ -582,7 +582,11 @@ CANDIDATES is a list of strings."
                        ivy--old-cands)
                       ((and ivy--old-re
                             (not (equal ivy--old-re ""))
-                            (eq 0 (cl-search ivy--old-re re)))
+                            (memq (cl-search
+                                   (if (string-match "\\\\)$" ivy--old-re)
+                                       (substring ivy--old-re 0 -2)
+                                     ivy--old-re)
+                                   re) '(0 2)))
                        (ignore-errors
                          (cl-remove-if-not
                           (lambda (x) (string-match re x))

Reply via email to