diff --git a/editor/src/main/java/com/itsaky/androidide/editor/ui/IDEEditor.kt b/editor/src/main/java/com/itsaky/androidide/editor/ui/IDEEditor.kt index 4904951a9..0228e1521 100644 --- a/editor/src/main/java/com/itsaky/androidide/editor/ui/IDEEditor.kt +++ b/editor/src/main/java/com/itsaky/androidide/editor/ui/IDEEditor.kt @@ -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)