1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:38:12 +00:00

HackStudio: Fix editor not marking file with unsaved changes as dirty

The editor's on_change callback was being overwritten in
HackStudioWidget.cpp in order to call update_gml_preview on every
change. This stopped the original callback from being called and marking
files as dirty when changed.

Now we call update_gml_preview in a new callback within the editor
wrapper, which is then called within the original on_change callback
in the editor.
This commit is contained in:
Lennon Donaghy 2021-08-03 20:40:42 +01:00 committed by Andreas Kling
parent d454c63bde
commit 82b88c6e16
3 changed files with 6 additions and 2 deletions

View file

@ -43,6 +43,8 @@ EditorWrapper::EditorWrapper()
};
m_editor->on_change = [this] {
if (this->on_change)
this->on_change();
bool was_dirty = m_document_dirty;
m_document_dirty = true;
if (!was_dirty)