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

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

[elpa] externals/ivy-hydra da0b272 281/395: ivy.el (ivy--call-marked): H


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra da0b272 281/395: ivy.el (ivy--call-marked): Handle alists
Date: Thu, 25 Feb 2021 08:32:20 -0500 (EST)

branch: externals/ivy-hydra
commit da0b272e8a421b3ffbabd0e2b1b419d797ab3a8f
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy--call-marked): Handle alists
    
    * ivy-test.el (ivy-read-alist-multi-cands): Add test.
    
    Fixes #2568
---
 ivy-test.el | 12 ++++++++++++
 ivy.el      |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ivy-test.el b/ivy-test.el
index 02c8b3f..fd0b463 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -209,6 +209,18 @@ Since `execute-kbd-macro' doesn't pick up a let-bound 
`default-directory'.")
                            "C-m")
                  '(("b" . "1") ("a" . "2")))))
 
+(ert-deftest ivy-read-alist-multi-cands ()
+  (should
+   (equal
+    (ivy-with '(let (acc)
+                 (ivy-read "test: "
+                           '(("Key 1" . "Data 1") ("Key 2" . "Data 2"))
+                           :action (lambda (x) (push x acc)))
+                 acc)
+              "M-a RET")
+    '(("Key 2" . "Data 2")
+      ("Key 1" . "Data 1")))))
+
 (ert-deftest ivy-read-sort-def ()
   (should (equal (ivy-with '(ivy-read "Test: " '("1" "2") :def '("a" "b" "c"))
                            "C-m")
diff --git a/ivy.el b/ivy.el
index 27f904c..08c93d4 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1536,7 +1536,7 @@ See variable `ivy-recursive-restore' for further 
information."
           (funcall multi-action marked-candidates))
       (dolist (c marked-candidates)
         (let ((default-directory (ivy-state-directory ivy-last)))
-          (funcall action c))))))
+          (funcall action (ivy--call-cand c)))))))
 
 (defun ivy--call-cand (current)
   (let ((collection (ivy-state-collection ivy-last)))



reply via email to

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