]> code.delx.au - gnu-emacs-elpa/commitdiff
swiper.el (swiper--ivy): Use minibuffer-allow-text-properties
authorOleh Krehel <ohwoeowho@gmail.com>
Tue, 22 Sep 2015 11:03:02 +0000 (13:03 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Tue, 22 Sep 2015 11:05:48 +0000 (13:05 +0200)
Using `minibuffer-allow-text-properties' makes Emacs not strip the text
properties from the result of `read-from-minibuffer'. This is better
because a function call result is used instead of a global var to pass
this info.

swiper.el

index 3f800f881576c3f8ed90970420f76ddb85b4f21d..cd13b8caacd5e69c28ac36958b7b0e2fa2d5c67d 100644 (file)
--- a/swiper.el
+++ b/swiper.el
@@ -266,22 +266,24 @@ Please remove it and update the \"swiper\" package."))
   (let ((candidates (swiper--candidates))
         (preselect (buffer-substring-no-properties
                     (line-beginning-position)
-                    (line-end-position))))
+                    (line-end-position)))
+        (minibuffer-allow-text-properties t)
+        res)
     (unwind-protect
-         (ivy-read
-          "Swiper: "
-          candidates
-          :initial-input initial-input
-          :keymap swiper-map
-          :preselect preselect
-          :require-match t
-          :update-fn #'swiper--update-input-ivy
-          :unwind #'swiper--cleanup
-          :re-builder #'swiper--re-builder
-          :history 'swiper-history)
+         (setq res (ivy-read
+                    "Swiper: "
+                    candidates
+                    :initial-input initial-input
+                    :keymap swiper-map
+                    :preselect preselect
+                    :require-match t
+                    :update-fn #'swiper--update-input-ivy
+                    :unwind #'swiper--cleanup
+                    :re-builder #'swiper--re-builder
+                    :history 'swiper-history))
       (if (null ivy-exit)
           (goto-char swiper--opoint)
-        (swiper--action ivy--current ivy-text)))))
+        (swiper--action res ivy-text)))))
 
 (defun swiper--ensure-visible ()
   "Remove overlays hiding point."