FileEditor () { VirtualFile contextFile = EditorConfigPreviewManager.getInstance(myProject).getAssociatedPreviewFile(myFile); EditorConfigStatusListener statusListener = new EditorConfigStatusListener(myProject, myFile); if (contextFile != null && CodeStyle.getSettings(myProject).getCustomSettings(EditorConfigSettings.class).ENABLED) { Document document =EditorFactory.getInstance().createDocument(getPreviewText(contextFile)); Disposable previewDisposable = Disposer.newDisposable(); final EditorConfigPreviewFile previewFile = new EditorConfigPreviewFile(myProject, contextFile, document, previewDisposable); FileEditor previewEditor = createPreviewEditor(document, previewFile); TextEditor ecTextEditor = (TextEditor)TextEditorProvider.getInstance().createEditor(myProject, myFile); final EditorConfigEditorWithPreview splitEditor = new EditorConfigEditorWithPreview( myFile, myProject, ecTextEditor, previewEditor); Disposer.register(splitEditor, previewDisposable); Disposer.register(splitEditor, statusListener); return splitEditor; } else { FileEditor fileEditor = myMainEditorProvider.createEditor(myProject, myFile); Disposer.register(fileEditor, statusListener); return fileEditor; } }