branch: master
commit 8d82b9892b76d8ff27cbf7e9a20a7c8037acf1a8
Author: Oleh Krehel <ohwoeo...@gmail.com>
Commit: Oleh Krehel <ohwoeo...@gmail.com>

    swiper.el (swiper-from-isearch): New command
    
    Fixes #180
---
 swiper.el |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/swiper.el b/swiper.el
index 5b22b78..e7bd574 100644
--- a/swiper.el
+++ b/swiper.el
@@ -360,6 +360,16 @@ BEG and END, when specified, are the point bounds."
         (push-mark swiper--opoint t)
         (message "Mark saved where search started")))))
 
+;; (define-key isearch-mode-map (kbd "C-o") 'swiper-from-isearch)
+(defun swiper-from-isearch ()
+  "Invoke `swiper' from isearch."
+  (interactive)
+  (let ((query (if isearch-regexp
+                   isearch-string
+                 (regexp-quote isearch-string))))
+    (isearch-exit)
+    (swiper query)))
+
 (provide 'swiper)
 
 ;;; swiper.el ends here

Reply via email to