void (@NotNull Editor editor, final @Nullable Caret contextCaret, final DataContext dataContext) { Editor hostEditor = dataContext == null ? null : CommonDataKeys.HOST_EDITOR.getData(dataContext); if (hostEditor == null) { hostEditor = editor; } if (contextCaret == null && runForAllCarets()) { hostEditor.getCaretModel().runForEachCaret(caret -> { if (myWorksInInjected) ensureInjectionUpToDate(caret); doIfEnabled(caret, dataContext, (caret1, dc) -> doExecute(caret1.getEditor(), caret1, dc)); }); } else { if (contextCaret == null) { if (myWorksInInjected) ensureInjectionUpToDate(hostEditor.getCaretModel().getCurrentCaret()); doIfEnabled(hostEditor.getCaretModel().getCurrentCaret(), dataContext, (caret, dc) -> doExecute(caret.getEditor(), null, dc)); } else { doExecute(editor, contextCaret, dataContext); } } }