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

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

[elpa] master 04b5734 03/90: swiper.el (swiper-avy): Don't start on empt


From: Oleh Krehel
Subject: [elpa] master 04b5734 03/90: swiper.el (swiper-avy): Don't start on empty input
Date: Tue, 30 Jun 2015 07:27:56 +0000

branch: master
commit 04b57348d1d835220093fea091d22e77cb77240c
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    swiper.el (swiper-avy): Don't start on empty input
    
    Fixes abo-abo/avy#50
---
 swiper.el |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/swiper.el b/swiper.el
index 6f98989..698e5dd 100644
--- a/swiper.el
+++ b/swiper.el
@@ -112,16 +112,17 @@
 (defun swiper-avy ()
   "Jump to one of the current swiper candidates."
   (interactive)
-  (with-selected-window (ivy-state-window ivy-last)
-    (let* ((avy-all-windows nil)
-           (candidates
-            (avy--regex-candidates
-             (ivy--regex ivy-text)))
-           (avy-background nil)
-           (candidate
-            (avy--process candidates #'avy--overlay-post)))
-      (ivy-quit-and-run
-       (avy--goto candidate)))))
+  (unless (string= ivy-text "")
+    (with-selected-window (ivy-state-window ivy-last)
+      (let* ((avy-all-windows nil)
+             (candidates
+              (avy--regex-candidates
+               (ivy--regex ivy-text)))
+             (avy-background nil)
+             (candidate
+              (avy--process candidates #'avy--overlay-post)))
+        (ivy-quit-and-run
+         (avy--goto candidate))))))
 
 (defun swiper-recenter-top-bottom (&optional arg)
   "Call (`recenter-top-bottom' ARG) in `swiper--window'."



reply via email to

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