branch: master commit 04b57348d1d835220093fea091d22e77cb77240c Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
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'."