boolean (@NotNull AnActionEvent e) { Editor editor = myConsoleViewHandler.getEditor(); if (editor == null) return false; Document document = editor.getDocument(); return document.getLineCount() == 0 || document.getLineNumber(editor.getCaretModel().getOffset()) == document.getLineCount() - 1; }