When pressing the custom x mapping in normal mode, :messages reads as expected:
Running action
action!
Ran action
However, :normal x silently fails to execute the action:
Running action
Ran action
This is also the case if we run the same basic code through a custom user command, :X in the above config:
Running action
Ran action
The only thing I can think to do is vim.schedule the mc.action so that it triggers asynchronously after the ex command is finished. So with the :Scheduled user command above:
Scheduling action
Scheduled action
ran action!
Is there anything smarter mc.action could do? I think ex commands are explicitly being short-circuited by this condition: https://github.com/jake-stewart/multicursor.nvim/blob/f68e66cb9d490662571f664c313b6eeca774b25a/lua/multicursor-nvim/input-manager.lua#L57-L59 I assume that's there so that when you're on the ex command line typing things, it doesn't feed input into the multicursors. But I'm also guessing self._cmdType remains truthy even after I hit <cr> and start executing my command that winds up trying to trigger the mc.action. I don't know enough about the control flow here to hazard a guess at any fixes, though.
Config:
When pressing the custom
x
mapping in normal mode,:messages
reads as expected:However,
:normal x
silently fails to execute the action:This is also the case if we run the same basic code through a custom user command,
:X
in the above config:The only thing I can think to do is
vim.schedule
themc.action
so that it triggers asynchronously after the ex command is finished. So with the:Scheduled
user command above:Is there anything smarter
mc.action
could do? I think ex commands are explicitly being short-circuited by this condition: https://github.com/jake-stewart/multicursor.nvim/blob/f68e66cb9d490662571f664c313b6eeca774b25a/lua/multicursor-nvim/input-manager.lua#L57-L59 I assume that's there so that when you're on the ex command line typing things, it doesn't feed input into the multicursors. But I'm also guessingself._cmdType
remains truthy even after I hit<cr>
and start executing my command that winds up trying to trigger themc.action
. I don't know enough about the control flow here to hazard a guess at any fixes, though.