]> code.delx.au - gnu-emacs-elpa/commitdiff
swiper.el (swiper--re-builder): Replace \t with 4 spaces
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 12 Feb 2016 08:41:03 +0000 (09:41 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 12 Feb 2016 08:41:03 +0000 (09:41 +0100)
Since `swiper--candidates' does it, `swiper--re-builder' must do the
same.

swiper.el

index 841bfe7ceb96bcdd2751d87ff0f45fda021807d4..e332035d59bf76b8c39fe9ad986cf3d5e7d8601e 100644 (file)
--- 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'.")