boolean (@NotNull AnActionEvent e) { Document document = myEditor.getDocument(); return document.getLineCount() == 0 || document.getLineNumber(myEditor.getCaretModel().getOffset()) == document.getLineCount() - 1; }