mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
fix(editor): modified status is not changed after content modification
This commit is contained in:
@@ -651,6 +651,8 @@ open class IDEEditor @JvmOverloads constructor(
|
||||
it.init()
|
||||
}
|
||||
|
||||
markUnmodified()
|
||||
|
||||
searcher = IDEEditorSearcher(this)
|
||||
colorScheme = SchemeAndroidIDE.newInstance(context)
|
||||
inputType = createInputTypeFlags()
|
||||
@@ -662,6 +664,7 @@ open class IDEEditor @JvmOverloads constructor(
|
||||
getComponent(EditorTextActionWindow::class.java).isEnabled = false
|
||||
|
||||
subscribeEvent(ContentChangeEvent::class.java) { event, _ ->
|
||||
markModified()
|
||||
file ?: return@subscribeEvent
|
||||
|
||||
editorScope.launch {
|
||||
@@ -829,6 +832,7 @@ open class IDEEditor @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
protected open fun dispatchDocumentSelectedEvent() {
|
||||
markUnmodified()
|
||||
val file = file ?: return
|
||||
val selectedEvent = DocumentSelectedEvent(file.toPath())
|
||||
EventBus.getDefault().post(selectedEvent)
|
||||
|
||||
Reference in New Issue
Block a user