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

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

[elpa] master 9e513d0 211/399: swiper.el (swiper-thing-at-point): Add


From: Oleh Krehel
Subject: [elpa] master 9e513d0 211/399: swiper.el (swiper-thing-at-point): Add
Date: Sat, 20 Jul 2019 14:57:25 -0400 (EDT)

branch: master
commit 9e513d00b40762cf83f3440c1c9e6f3dc82b5e01
Author: Masashi Miyaura <address@hidden>
Commit: Oleh Krehel <address@hidden>

    swiper.el (swiper-thing-at-point): Add
    
    Fixes #2027
---
 swiper.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/swiper.el b/swiper.el
index 64ea999..b49a85f 100644
--- a/swiper.el
+++ b/swiper.el
@@ -503,6 +503,15 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
   (interactive)
   (swiper--ivy (swiper--candidates) initial-input))
 
+;;;###autoload
+(defun swiper-thing-at-point ()
+  "`swiper' with `ivy-thing-at-point'."
+  (interactive)
+  (let ((thing (ivy-thing-at-point)))
+    (when (use-region-p)
+      (deactivate-mark))
+    (swiper thing)))
+
 (defvar swiper--current-window-start nil
   "Store `window-start' to restore it later.
 This prevents a \"jumping\" behavior which occurs when variables



reply via email to

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