@@ -31,15 +31,13 @@ import com.intellij.util.ui.JBUI
31
31
import cc.unitmesh.devti.sketch.ui.LangSketch
32
32
import cc.unitmesh.devti.sketch.ui.LanguageSketchProvider
33
33
import com.intellij.ide.scratch.ScratchRootType
34
+ import com.intellij.openapi.fileEditor.FileEditor
34
35
import com.intellij.openapi.fileEditor.FileEditorProvider
35
36
import com.intellij.openapi.fileEditor.TextEditorWithPreview
36
- import com.intellij.openapi.fileEditor.impl.text.TextEditorProvider
37
37
import com.intellij.openapi.util.text.StringUtil
38
38
import com.intellij.psi.PsiManager
39
39
import com.intellij.temporary.gui.block.whenDisposed
40
40
import com.intellij.util.ui.JBEmptyBorder
41
- import org.intellij.plugins.markdown.lang.MarkdownLanguage
42
- import org.intellij.plugins.markdown.ui.preview.MarkdownEditorWithPreview
43
41
import java.awt.BorderLayout
44
42
import javax.swing.BoxLayout
45
43
import javax.swing.JButton
@@ -59,6 +57,7 @@ open class CodeHighlightSketch(
59
57
private var textLanguage: String? = null
60
58
61
59
var editorFragment: EditorFragment ? = null
60
+ var previewEditor: FileEditor ? = null
62
61
private var hasSetupAction = false
63
62
64
63
init {
@@ -88,9 +87,9 @@ open class CodeHighlightSketch(
88
87
89
88
if (ideaLanguage?.displayName == " DevIn" ) {
90
89
isDevIns = true
91
- editorFragment = EditorFragment (editor, devinLineThreshold)
90
+ editorFragment = EditorFragment (editor, devinLineThreshold, previewEditor )
92
91
} else {
93
- editorFragment = EditorFragment (editor, editorLineThreshold)
92
+ editorFragment = EditorFragment (editor, editorLineThreshold, previewEditor )
94
93
}
95
94
96
95
add(editorFragment!! .getContent(), BorderLayout .CENTER )
@@ -114,6 +113,9 @@ open class CodeHighlightSketch(
114
113
val preview = createEditor as ? TextEditorWithPreview ? : return null
115
114
var editor = preview?.editor as ? EditorEx ? : return null
116
115
configEditor(editor, project, file, false )
116
+ // previewEditor = preview.previewEditor
117
+ // previewEditor?.component?.isOpaque = true
118
+ // previewEditor?.component?.minimumSize = JBUI.size(0, 0)
117
119
return editor
118
120
}
119
121
0 commit comments