1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-04-07 11:15:47 +02:00

Use the proper context component when firing an action

This commit is contained in:
Alex Plate 2025-03-11 17:41:51 +02:00
parent 3808bfea60
commit 84b485c6bc
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F

View File

@ -87,10 +87,9 @@ internal class IjActionExecutor : VimActionExecutor {
} else {
try {
isRunningActionFromVim = true
// DataContext is build on the context component.
// However, it should be null as in this case the data context is taken from the context and the
// PlatformDataKeys.EDITOR is properly set.
val contextComponent: Component? = null
// The context component should be editor. This is especially important when running the `:action` commands
// because at the moment of execution, the focused component is Ex Field, not editor.
val contextComponent = editor?.ij?.contentComponent
val res = ActionManager.getInstance().tryToExecute(ijAction, null, contextComponent, "IdeaVim", true)
res.waitFor(5_000)
return res.isDone