void (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { if (LOG.isDebugEnabled()) { LOG.debug("enter: execute(editor='" + editor + "')"); } Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project == null) { if (myOriginalHandler != null) { myOriginalHandler.execute(editor, caret, dataContext); } return; } PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument()); TextRange range = selectWord(caret, project); if (editor instanceof EditorWindow) { if (range == null || !isInsideEditableInjection((EditorWindow)editor, range, project) || TextRange.from(0, editor.getDocument().getTextLength()).equals( new TextRange(caret.getSelectionStart(), caret.getSelectionEnd()))) { editor = ((EditorWindow)editor).getDelegate(); caret = ((InjectedCaret)caret).getDelegate(); range = selectWord(caret, project); } } if (range == null) { if (myOriginalHandler != null) { myOriginalHandler.execute(editor, caret, dataContext); } } else { caret.setSelection(range.getStartOffset(), range.getEndOffset()); } }