emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ivy-hydra 1b3d0a3 072/395: ivy.el (ivy--split): Fix for


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 1b3d0a3 072/395: ivy.el (ivy--split): Fix for "\\" input
Date: Thu, 25 Feb 2021 08:31:34 -0500 (EST)

branch: externals/ivy-hydra
commit 1b3d0a33418766c76bc9aab982037a79ec624257
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy--split): Fix for "\\" input
    
    * ivy-test.el (ivy--regex): Add test.
    
    Fixes #2343
---
 ivy-test.el | 3 ++-
 ivy.el      | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ivy-test.el b/ivy-test.el
index 5e10fe0..97e46a4 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -266,7 +266,8 @@ will bring the behavior in line with the newer Emacsen."
   (should (equal (ivy--regex "[^ \n]+\\( -> \\).*")
                  "\\([^ \n]+\\)\\( -> \\).*?\\(.*\\)"))
   (should (equal (ivy--regex "\\([^ \\n]+\\)\\( -> \\).*")
-                 "\\([^ \\n]+\\)\\( -> \\).*?\\(.*\\)")))
+                 "\\([^ \\n]+\\)\\( -> \\).*?\\(.*\\)"))
+  (should (equal (ivy--regex "\\\\") "\\\\")))
 
 (ert-deftest ivy--split-negation ()
   (should (equal (ivy--split-negation "") ()))
diff --git a/ivy.el b/ivy.el
index d8e4083..e9de309 100644
--- a/ivy.el
+++ b/ivy.el
@@ -2687,7 +2687,7 @@ regexp is passed to `regexp-quote'."
                  (setq ivy--input-garbage (substring str i))
                  (throw 'break nil)))
               ((= ?\\ c)
-               (if (= ?\( (aref str (1+ i)))
+               (if (and (< (1+ i) len) (= ?\( (aref str (1+ i))))
                    (progn
                      (when (> i start)
                        (push (substring str start i) res))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]