]> code.delx.au - gnu-emacs-elpa/commitdiff
ivy.el (ivy-completing-read): Fix off by one
authorOleh Krehel <ohwoeowho@gmail.com>
Wed, 18 Nov 2015 13:34:46 +0000 (14:34 +0100)
committerOleh Krehel <ohwoeowho@gmail.com>
Wed, 18 Nov 2015 13:34:46 +0000 (14:34 +0100)
Re #295

ivy.el

diff --git a/ivy.el b/ivy.el
index 7f7940635dba9ed3e3d6238c1527b94546c9ed10..9fd181aa9a206aab2fef274f1a6e95d9a9cb75b5 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -1238,7 +1238,7 @@ The history, defaults and input-method arguments are ignored for now."
   ;; See the doc of `completing-read'.
   (when (consp history)
     (when (numberp (cdr history))
-      (setq initial-input (nth (cdr history)
+      (setq initial-input (nth (1- (cdr history))
                                (symbol-value (car history)))))
     (setq history (car history)))
   (ivy-read (replace-regexp-in-string "%" "%%" prompt)