@NotNull
  protected Editor createEditor(@Nullable Project project, Document document, @NotNull VirtualFile file) {
    EditorEx editor = (EditorEx)EditorFactory.getInstance().createViewer(document, project, EditorKind.PREVIEW);

    final EditorColorsScheme scheme = EditorColorsManager.getInstance().getGlobalScheme();
    EditorHighlighter highlighter = EditorHighlighterFactory.getInstance().createEditorHighlighter(file, scheme, project);

    editor.setFile(file);
    editor.setHighlighter(highlighter);

    EditorSettings settings = editor.getSettings();
    settings.setAnimatedScrolling(false);
    settings.setRefrainFromScrolling(false);
    settings.setLineNumbersShown(true);
    settings.setFoldingOutlineShown(false);
    editor.getFoldingModel().setFoldingEnabled(false);

    return editor;
  }
@NotNull
  protected Editor createEditor(@Nullable Project project, Document document, @NotNull VirtualFile file)