]> code.delx.au - gnu-emacs-elpa/commitdiff
Reset to the first candidate when switching directories
authorOleh Krehel <ohwoeowho@gmail.com>
Fri, 24 Apr 2015 09:54:46 +0000 (11:54 +0200)
committerOleh Krehel <ohwoeowho@gmail.com>
Fri, 24 Apr 2015 09:54:46 +0000 (11:54 +0200)
* ivy.el (ivy--cd): Update.

ivy.el

diff --git a/ivy.el b/ivy.el
index 0275a2cc41664ed45ae1b4c80c602e15d354bb06..8b95c9f7301b9c41078815c3edc4e79204cc58d4 100644 (file)
--- a/ivy.el
+++ b/ivy.el
@@ -336,6 +336,7 @@ If the input is empty, select the previous history element instead."
       (error "Unexpected")
     (setq ivy--old-cands nil)
     (setq ivy--old-re nil)
+    (setq ivy--index 0)
     (setq ivy--all-candidates
           (ivy--sorted-files (setq ivy--directory dir)))
     (setq ivy-text "")