boolean (@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) { TemplateState templateState = TemplateManagerImpl.getTemplateState(editor); if (templateState != null && !templateState.isFinished()) { TextRange range = templateState.getCurrentVariableRange(); int caretOffset = editor.getCaretModel().getOffset(); if (range != null && range.containsOffset(caretOffset)) return true; } return myOriginalHandler.isEnabled(editor, caret, dataContext); }