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

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

[elpa] master a953af0 19/57: Simplify ivy-partial-or-done


From: Oleh Krehel
Subject: [elpa] master a953af0 19/57: Simplify ivy-partial-or-done
Date: Tue, 19 May 2015 14:21:27 +0000

branch: master
commit a953af021c064b7a8413360a0dad7d04e5998631
Author: Tassilo Horn <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Simplify ivy-partial-or-done
---
 ivy.el |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/ivy.el b/ivy.el
index e42f8c3..d130a77 100644
--- a/ivy.el
+++ b/ivy.el
@@ -281,14 +281,10 @@ When ARG is t, exit with current text, ignoring the 
candidates."
 When called twice in a row, exit the minibuffer with the current
 candidate."
   (interactive)
-  (if (eq this-command last-command)
-      (ivy-alt-done)
-    (unless (ivy-partial)
-      (when (and (eq confirm-nonexistent-file-or-buffer t)
-                       (memq (ivy-state-collection ivy-last)
-                             '(read-file-name-internal
-                               internal-complete-buffer)))
-        (ivy-done)))))
+  (or (ivy-partial)
+      (if (eq this-command last-command)
+         (ivy-done)
+       (ivy-alt-done))))
 
 (defun ivy-partial ()
   "Complete the minibuffer text as much as possible."
@@ -299,8 +295,8 @@ candidate."
          (new (try-completion postfix
                               (mapcar (lambda (str) (substring str 
(string-match postfix str)))
                                       ivy--old-cands))))
-    (cond ((eq new t)
-           nil)
+    (cond ((eq new t) nil)
+         ((string= new ivy-text) nil)
           (new
            (delete-region (minibuffer-prompt-end) (point-max))
            (setcar (last parts) new)



reply via email to

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