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

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

[elpa] master 2c39e10 04/57: "TAB" shouldn't delete input when no candid


From: Oleh Krehel
Subject: [elpa] master 2c39e10 04/57: "TAB" shouldn't delete input when no candidate
Date: Tue, 19 May 2015 14:21:19 +0000

branch: master
commit 2c39e102a38621acdeca5362917f8f3e11aed3fe
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    "TAB" shouldn't delete input when no candidate
    
    ivy.el (ivy-partial-or-done): Update.
    
    Fixes #74
---
 ivy.el |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ivy.el b/ivy.el
index 980046b..15506e2 100644
--- a/ivy.el
+++ b/ivy.el
@@ -279,7 +279,7 @@ When called twice in a row, exit the minibuffer with the 
current
 candidate."
   (interactive)
   (if (eq this-command last-command)
-      (progn
+      (when (> (length ivy--current) 0)
         (delete-minibuffer-contents)
         (insert ivy--current)
         (setq ivy-exit 'done)
@@ -290,10 +290,11 @@ candidate."
            (new (try-completion postfix
                                 (mapcar (lambda (str) (substring str 
(string-match postfix str)))
                                         ivy--old-cands))))
-      (delete-region (minibuffer-prompt-end) (point-max))
-      (setcar (last parts) new)
-      (insert (mapconcat #'identity parts " ")
-              (if ivy-tab-space " " "")))))
+      (when new
+        (delete-region (minibuffer-prompt-end) (point-max))
+        (setcar (last parts) new)
+        (insert (mapconcat #'identity parts " ")
+                (if ivy-tab-space " " ""))))))
 
 (defun ivy-immediate-done ()
   "Exit the minibuffer with the current input."



reply via email to

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