]> code.delx.au - gnu-emacs-elpa/blobdiff - ivy.el
ivy.el (ivy-avy): Make "C-g" cancel gracefully
[gnu-emacs-elpa] / ivy.el
diff --git a/ivy.el b/ivy.el
index 37648bb8d77f863850eac803f1b6beca9f1d8459..d082c8e0599a689a357e92e57e228e077174fe80 100644 (file)
--- 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.