@NotNull
  private EditorEx createConsoleEditor() {
    ThreadingAssertions.assertEventDispatchThread();
    EditorEx editor = doCreateConsoleEditor();
    LOG.assertTrue(UndoUtil.isUndoDisabledFor(editor.getDocument()), "Undo must be disabled in console for performance reasons");
    LOG.assertTrue(!((DocumentImpl)editor.getDocument()).isWriteThreadOnly(), "Console document must support background modifications, see e.g. ConsoleViewUtil.setupConsoleEditor() "+getClass());
    editor.installPopupHandler(new ContextMenuPopupHandler() {
      @Override
      public ActionGroup getActionGroup(@NotNull EditorMouseEvent event) {
        return getPopupGroup(event);
      }
    });

    int bufferSize = ConsoleBuffer.useCycleBuffer() ? ConsoleBuffer.getCycleBufferSize() : 0;
    editor.getDocument().setCyclicBufferSize(bufferSize);
    editor.getDocument().putUserData(IS_CONSOLE_DOCUMENT, true);
    editor.putUserData(CONSOLE_VIEW_IN_EDITOR_VIEW, this);
    editor.getSettings().setAllowSingleLogicalLineFolding(true); // We want to fold long soft-wrapped command lines
    return editor;
  }
@NotNull
  private EditorEx createConsoleEditor()