I'm not sure whether this is the intended behavior, but when I repeatedly call ivy-read with a list of actions, the default action seems to constantly update to the last action I applied.
Here is an example. As in section 6.3.5 of the ivy documentation I define the following:
(defun my-action-1 (x)
(message "action-1: %s" x))
(defun my-action-2 (x)
(message "action-2: %s" x))
(defun my-action-3 (x)
(message "action-3: %s" x))
(defun my-command-with-3-actions ()
(interactive)
(ivy-read "test: " '("foo" "bar" "baz")
:action '(1
("o" my-action-1 "action 1")
("j" my-action-2 "action 2")
("k" my-action-3 "action 3"))))
If I call my-command-with-3-actions, select candidate foo and hit RET, I get action-1: foo. If I understand correctly, this is because RET applies the default action and the number 1 at the beginning of the action list identifies the first action as the default one.
But if I now call my-command-with-3-actions, select foo and apply the second action (hitting M-o j), then call my-command-with-3-actions again, select foo and hit RET, the second action is applied whereas I would expect the default, first one to be applied.
Am I getting something wrong?
Thanks
I'm not sure whether this is the intended behavior, but when I repeatedly call
ivy-readwith a list of actions, the default action seems to constantly update to the last action I applied.Here is an example. As in section 6.3.5 of the
ivydocumentation I define the following:If I call
my-command-with-3-actions, select candidatefooand hitRET, I getaction-1: foo. If I understand correctly, this is becauseRETapplies the default action and the number1at the beginning of the action list identifies the first action as the default one.But if I now call
my-command-with-3-actions, selectfooand apply the second action (hittingM-o j), then callmy-command-with-3-actionsagain, selectfooand hitRET, the second action is applied whereas I would expect the default, first one to be applied.Am I getting something wrong?
Thanks