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

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

[elpa] master d544427 093/272: swiper.el (swiper--re-builder): Replace \


From: Oleh Krehel
Subject: [elpa] master d544427 093/272: swiper.el (swiper--re-builder): Replace \t with 4 spaces
Date: Mon, 25 Apr 2016 10:13:18 +0000

branch: master
commit d544427adf5a3b0f538e164e56a8bc98572e2761
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    swiper.el (swiper--re-builder): Replace \t with 4 spaces
    
    Since `swiper--candidates' does it, `swiper--re-builder' must do the
    same.
---
 swiper.el |   32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/swiper.el b/swiper.el
index 841bfe7..e332035 100644
--- a/swiper.el
+++ b/swiper.el
@@ -372,21 +372,23 @@ When non-nil, INITIAL-INPUT is the initial search 
pattern."
   "Transform STR into a swiper regex.
 This is the regex used in the minibuffer, since the candidates
 there have line numbers. In the buffer, `ivy--regex' should be used."
-  (cond
-    ((equal str "")
-     "")
-    ((equal str "^")
-     (setq ivy--subexps 0)
-     ".")
-    ((string-match "^\\^" str)
-     (setq ivy--old-re "")
-     (let ((re (ivy--regex-plus (substring str 1))))
-       (if (zerop ivy--subexps)
-           (prog1 (format "^ ?\\(%s\\)" re)
-             (setq ivy--subexps 1))
-         (format "^ %s" re))))
-    (t
-     (ivy--regex-plus str))))
+  (replace-regexp-in-string
+   "\t" "    "
+   (cond
+     ((equal str "")
+      "")
+     ((equal str "^")
+      (setq ivy--subexps 0)
+      ".")
+     ((string-match "^\\^" str)
+      (setq ivy--old-re "")
+      (let ((re (ivy--regex-plus (substring str 1))))
+        (if (zerop ivy--subexps)
+            (prog1 (format "^ ?\\(%s\\)" re)
+              (setq ivy--subexps 1))
+          (format "^ %s" re))))
+     (t
+      (ivy--regex-plus str)))))
 
 (defvar swiper-history nil
   "History for `swiper'.")



reply via email to

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