[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra b2af619 322/395: ivy.el (ivy--call-marked): D
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra b2af619 322/395: ivy.el (ivy--call-marked): Don't call multi-action if non-default action was chosen |
Date: |
Thu, 25 Feb 2021 08:32:30 -0500 (EST) |
branch: externals/ivy-hydra
commit b2af61949a82046963e2f2bad3886f7375290ea3
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el (ivy--call-marked): Don't call multi-action if non-default action
was chosen
Instead, call the chosen non-default action on each candidate.
* ivy-test.el (ivy-read-multi-action): Add test.
Fixes #2598
---
ivy-test.el | 13 +++++++++++++
ivy.el | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/ivy-test.el b/ivy-test.el
index f79504e..3864cd6 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -234,6 +234,19 @@ Since `execute-kbd-macro' doesn't pick up a let-bound
`default-directory'.")
'(("Key 1" . "Data 1")
("Key 2" . "Data 2")))))
+(ert-deftest ivy-read-multi-action ()
+ (should (equal (let ((res nil))
+ (ivy-add-actions 'test-ivy-read-multi-action
+ (list (list "a" (lambda (x) (push x res))
"action-a")))
+ (ivy-with
+ '(ivy-read "test: " '("x" "y")
+ :action (lambda (x) (message "Default: %s" x))
+ :multi-action (lambda (xs) (message "Default:
%S" xs))
+ :caller 'test-ivy-read-multi-action)
+ "M-a M-o a")
+ res)
+ '("y" "x"))))
+
(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 7444bfc..b142d79 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1419,7 +1419,7 @@ See variable `ivy-recursive-restore' for further
information."
cand)))
ivy-marked-candidates))
(multi-action (ivy--get-multi-action ivy-last)))
- (if multi-action
+ (if (and multi-action (eq (car (ivy-state-action ivy-last)) 1))
(let ((default-directory (ivy-state-directory ivy-last)))
(funcall multi-action (mapcar #'ivy--call-cand marked-candidates)))
(dolist (c marked-candidates)
- [elpa] externals/ivy-hydra 8383dd6 248/395: * counsel.el: Unquote lambda actions, (continued)
- [elpa] externals/ivy-hydra 8383dd6 248/395: * counsel.el: Unquote lambda actions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6916cbd 256/395: doc/ivy.org: Document ivy-insert-current-full, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ace2475 260/395: counsel.el (counsel--sync-sentinel-on-exit): Fix regression, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f1472ef 266/395: ivy.el: When completing files, make "RET" reverse "DEL", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 82cb9da 272/395: ivy.el (ivy--do-shrink-window): Account for the extra prompt height, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6f50fca 286/395: ivy.el: When reading file names, take the non-directory part of :initial-input, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d452878 291/395: counsel-grep/ag/rg/pt/...: Allow to deplay subprocess creation, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 84dfbf8 296/395: ivy-avy.el: Checkdoc, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 864570a 323/395: ivy.el (ivy--get-multi-action): Fix and add a test, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 05c12fc 310/395: counsel.el (counsel--grep-smart-case-flag): Check if base command is a string, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b2af619 322/395: ivy.el (ivy--call-marked): Don't call multi-action if non-default action was chosen,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 683a7b7 309/395: ivy.el (ivy-completion-in-region): Fix "^" and C-g, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ea9bd06 353/395: Encode --pcre switch correctly for ivy-occur, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 63549da 354/395: Fix counsel-descbinds for Emacs 28, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 387390b 312/395: Prefer derived-mode-p for major-mode comparisons, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8d840b2 317/395: counsel.el (counsel-find-file-undo): Undo changing current directory, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9bb6841 347/395: counsel.el (counsel-highlight-with-face): Fix preselect on next call, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra dd9c88f 319/395: ivy-avy.el: Fix package-lint warnings, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 544e7de 314/395: ivy.el (ivy-completing-read): Work better with find-file-at-point, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4f98f97 332/395: targets/plain.el: Install avy automatically, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6a22192 360/395: ivy.el (ivy--highlight-default): Use match faces consistently, Basil L. Contovounesios, 2021/02/25