branch: master commit b01108e167ad26139535a516a056063d7ea4fff6 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
ivy.el (ivy-call): Call action with whole marked list if it has a second arg Re #561 --- ivy.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ivy.el b/ivy.el index f7a997f..6db8e00 100644 --- a/ivy.el +++ b/ivy.el @@ -1312,8 +1312,14 @@ will be called for each element of this list.") (set-buffer (ivy-state-buffer ivy-last)) (prog1 (unwind-protect (if ivy-marked-candidates - (dolist (c ivy-marked-candidates) - (funcall action (substring c (length ivy-mark-prefix)))) + (let ((l (length ivy-mark-prefix))) + (setq ivy-marked-candidates + (mapcar (lambda (s) (substring s l)) + ivy-marked-candidates)) + (if (> (length (help-function-arglist action)) 1) + (funcall action x ivy-marked-candidates) + (dolist (c ivy-marked-candidates) + (funcall action c)))) (funcall action x)) (ivy-recursive-restore)) (unless (or (eq ivy-exit 'done)