Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf72bac6

Browse files
committed
feat(sketch): 优化Sketch模式下文件写入行为
在Sketch模式启用时跳过自动打开文件编辑器,避免干扰用户工作流程。通过检查AutoSketchMode状态来决定是否调用FileEditorManager.openFile()。
1 parent0de0658 commitf72bac6

File tree

1 file changed

+4
-1
lines changed
  • exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec

1 file changed

+4
-1
lines changed

‎exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/WriteInsCommand.kt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import cc.unitmesh.devti.command.dataprovider.BuiltinCommand
55
importcc.unitmesh.devti.language.compiler.error.DEVINS_ERROR
66
importcc.unitmesh.devti.language.psi.DevInUsed
77
importcc.unitmesh.devti.language.utils.lookupFile
8+
importcc.unitmesh.devti.sketch.AutoSketchMode
89
importcc.unitmesh.devti.sketch.ui.patch.writeText
910
importcom.intellij.openapi.application.ApplicationManager
1011
importcom.intellij.openapi.application.runInEdt
@@ -37,7 +38,9 @@ class WriteInsCommand(val myProject: Project, val argument: String, val content:
3738
val virtualFile= runReadAction { myProject.lookupFile(filepath) }!!
3839
runInEdt {
3940
virtualFile.writeText(content)
40-
FileEditorManager.getInstance(myProject).openFile(virtualFile,true)
41+
if (!AutoSketchMode.getInstance(myProject).isEnable) {
42+
FileEditorManager.getInstance(myProject).openFile(virtualFile,true)
43+
}
4144
}
4245

4346
return"Writing to file:$argument"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp