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

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

[elpa] master 6bf2cba 053/184: ivy.el (ivy-read-action-ivy): Don't recur


From: Oleh Krehel
Subject: [elpa] master 6bf2cba 053/184: ivy.el (ivy-read-action-ivy): Don't recur
Date: Wed, 16 Oct 2019 13:14:47 -0400 (EDT)

branch: master
commit 6bf2cbafc31c84dd4be0c327d09640738546d58a
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    ivy.el (ivy-read-action-ivy): Don't recur
---
 ivy.el | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/ivy.el b/ivy.el
index 67b9379..249a403 100644
--- a/ivy.el
+++ b/ivy.el
@@ -916,14 +916,17 @@ selection, non-nil otherwise."
 (defun ivy-read-action-ivy (actions)
   "Select an action from ACTIONS using Ivy."
   (let ((enable-recursive-minibuffers t))
-    (ivy-read "action: "
-              (cl-mapcar
-               (lambda (a i) (cons (format "[%s] %s" (nth 0 a) (nth 2 a)) i))
-               (cdr actions) (number-sequence 1 (length (cdr actions))))
-              :action (lambda (a)
-                        (setcar actions (cdr a))
-                        (ivy-set-action actions))
-              :caller 'ivy-read-action-ivy)))
+    (if (and (> (minibuffer-depth) 1)
+             (eq (ivy-state-caller ivy-last) 'ivy-read-action-ivy))
+        (minibuffer-keyboard-quit)
+      (ivy-read "action: "
+                (cl-mapcar
+                 (lambda (a i) (cons (format "[%s] %s" (nth 0 a) (nth 2 a)) i))
+                 (cdr actions) (number-sequence 1 (length (cdr actions))))
+                :action (lambda (a)
+                          (setcar actions (cdr a))
+                          (ivy-set-action actions))
+                :caller 'ivy-read-action-ivy))))
 
 (defun ivy-shrink-after-dispatching ()
   "Shrink the window after dispatching when action list is too large."



reply via email to

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