File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/code Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import com.intellij.openapi.editor.ex.EditorMarkupModel
16
16
import com.intellij.openapi.editor.ex.FocusChangeListener
17
17
import com.intellij.openapi.editor.ex.MarkupModelEx
18
18
import com.intellij.openapi.editor.highlighter.EditorHighlighterFactory
19
+ import com.intellij.openapi.fileTypes.PlainTextLanguage
19
20
import com.intellij.openapi.project.Project
20
21
import com.intellij.openapi.vfs.VirtualFile
21
22
import com.intellij.testFramework.LightVirtualFile
@@ -32,13 +33,14 @@ object EditorUtil {
32
33
disposable : Disposable ,
33
34
): EditorEx {
34
35
var editorText = text
35
- val language = ideaLanguage ? : CodeFence .findLanguage( " Plain text " )
36
- val ext = if (language.displayName == " Plain text " ) {
36
+ val language = ideaLanguage ? : PlainTextLanguage . INSTANCE
37
+ val ext = if (language.displayName == PlainTextLanguage . INSTANCE .displayName ) {
37
38
CodeFence .lookupFileExt(language.displayName)
38
39
} else {
39
40
language.associatedFileType?.defaultExtension ? : " Unknown"
40
41
}
41
- // / check text easyline starts with Lineno and :, for example: 1:
42
+
43
+ // / check text easy line starts with Lineno and : for example, 1:
42
44
var isShowLineNo = true
43
45
editorText.lines().forEach {
44
46
if (! it.matches(LINE_NO_REGEX )) {
You can’t perform that action at this time.
0 commit comments