emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 3f41ce6 58/90: Put the file instead of partial input on hi


From: Oleh Krehel
Subject: [elpa] master 3f41ce6 58/90: Put the file instead of partial input on history
Date: Tue, 30 Jun 2015 07:28:40 +0000

branch: master
commit 3f41ce69ceaa7395d24c64861b400f373993482a
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Put the file instead of partial input on history
    
    * ivy.el (ivy-read): When completing file names, put the whole file name
    on history, not just the partial input that lead to that name.
    This is important in order for `ivy--cd-maybe' to work.
    
    Re #152
---
 ivy.el |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ivy.el b/ivy.el
index ad4fe14..f6bd42c 100644
--- a/ivy.el
+++ b/ivy.el
@@ -824,9 +824,12 @@ candidates with each input."
                             nil
                             hist)))
                  (when (eq ivy-exit 'done)
-                   (set hist (cons (propertize ivy-text 'ivy-index ivy--index)
-                                   (delete ivy-text
-                                           (cdr (symbol-value hist)))))
+                   (let ((item (if ivy--directory
+                                   ivy--current
+                                 ivy-text)))
+                     (set hist (cons (propertize item 'ivy-index ivy--index)
+                                     (delete item
+                                             (cdr (symbol-value hist))))))
                    res)))
           (remove-hook 'post-command-hook #'ivy--exhibit)
           (when (setq unwind (ivy-state-unwind ivy-last))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]