Document (@NotNull String initialText, boolean viewer) { if (needSlashRSupport(initialText, viewer)){ return ((EditorFactoryImpl)EditorFactory.getInstance()).createDocument(initialText, true, false); } else { return EditorFactory.getInstance().createDocument(StringUtil.convertLineSeparators(initialText)); } }