private static @NotNull EditorEx createEditor(Project project, @Nullable Language language, boolean inheritFontFromLaF) {
      Language adjustedLanguage = language != null ? language : PlainTextLanguage.INSTANCE;
      EditorTextFieldRendererDocument document = new EditorTextFieldRendererDocument();

      EditorEx editor = (EditorEx)EditorFactory.getInstance().createViewer(document, project);
      editor.putUserData(EditorTextField.SUPPLEMENTARY_KEY, true);

      EditorSettings settings = editor.getSettings();
      EditorTextField.setupTextFieldEditor(editor);

      editor.setRendererMode(true);
      editor.getScrollPane().setBorder(null);
      settings.setCaretRowShown(false);
      settings.setAnimatedScrolling(false);

      if (project != null) {
        EditorHighlighterFactory highlighterFactory = EditorHighlighterFactory.getInstance();
        LightVirtualFile virtualFile = new LightVirtualFile("_", adjustedLanguage, "");
        EditorHighlighter highlighter = highlighterFactory.createEditorHighlighter(project, virtualFile);
        editor.setHighlighter(highlighter);
      }

      EditorColorsScheme colorsScheme = editor.getColorsScheme();
      editor.setBackgroundColor(StartupUiUtil.isUnderDarcula()
                                ? UIUtil.getTextFieldBackground()
                                : colorsScheme.getDefaultBackground());
      if (inheritFontFromLaF) {
        ((EditorImpl)editor).setUseEditorAntialiasing(false);
        Font font = StartupUiUtil.getLabelFont();
        colorsScheme.setEditorFontName(font.getFontName());
        colorsScheme.setEditorFontSize(font.getSize());
      }
      else {
        UISettings uiSettings = UISettings.getInstance();
        if (uiSettings.getPresentationMode()) {
          editor.setFontSize(UISettingsUtils.with(uiSettings).getPresentationModeFontSize());
        }
      }

      return editor;
    }
private static @NotNull EditorEx createEditor(Project project, @Nullable Language language, boolean inheritFontFromLaF)