From dabd1f82c8960a038b905213a0561536d599ecac Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Sat, 26 Mar 2016 14:22:40 +0100 Subject: [PATCH] ivy.el (ivy-avy): Make "C-g" cancel gracefully Fixes abo-abo/avy#140 --- ivy.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ivy.el b/ivy.el index 37648bb8d..d082c8e05 100644 --- a/ivy.el +++ b/ivy.el @@ -1080,9 +1080,10 @@ On error (read-only), call `ivy-on-del-error-function'." (avy--process (nreverse candidates) (avy--style-fn avy-style))))) - (ivy-set-index (- (line-number-at-pos candidate) 2)) - (ivy--exhibit) - (ivy-done))) + (when (numberp candidate) + (ivy-set-index (- (line-number-at-pos candidate) 2)) + (ivy--exhibit) + (ivy-done)))) (defun ivy-sort-file-function-default (x y) "Compare two files X and Y. -- 2.39.2