branch: externals/ivy-hydra
commit c5e162af215b97d6ce92ca894f60d52d9551efb3
Author: Hong Xu <[email protected]>
Commit: Oleh Krehel <[email protected]>

    swiper.el (swiper-thing-at-point): Use regexp-quote
    
    This helps when thing-at-point is symbols like 1+, c++-mode, etc.
    
    Fixes #2292
---
 swiper.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/swiper.el b/swiper.el
index d8c6f54..fde1bf0 100644
--- a/swiper.el
+++ b/swiper.el
@@ -565,7 +565,7 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
   (let ((thing (ivy-thing-at-point)))
     (when (use-region-p)
       (deactivate-mark))
-    (swiper thing)))
+    (swiper (regexp-quote thing))))
 
 ;;;###autoload
 (defun swiper-all-thing-at-point ()
@@ -574,7 +574,7 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
   (let ((thing (ivy-thing-at-point)))
     (when (use-region-p)
       (deactivate-mark))
-    (swiper-all thing)))
+    (swiper-all (regexp-quote thing))))
 
 (defun swiper--extract-matches (regex cands)
   "Extract captured REGEX groups from CANDS."

Reply via email to