1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:47:34 +00:00

TextEditor: Make sure to mark the Window as unmodified after saving

This comes with a FIXME, as it would be nicer if this information
would propagate from TextDocument all the way out somehow.
This commit is contained in:
Andreas Kling 2021-05-01 19:07:57 +02:00
parent f0cc712246
commit a7fb50567b

View file

@ -300,6 +300,9 @@ MainWidget::MainWidget()
} }
editor().document().set_modified(false); editor().document().set_modified(false);
// FIXME: It would be cool if this would propagate from GUI::TextDocument somehow.
window()->set_modified(false);
set_path(LexicalPath(save_path.value())); set_path(LexicalPath(save_path.value()));
dbgln("Wrote document to {}", save_path.value()); dbgln("Wrote document to {}", save_path.value());
}); });
@ -310,6 +313,9 @@ MainWidget::MainWidget()
GUI::MessageBox::show(window(), "Unable to save file.\n", "Error", GUI::MessageBox::Type::Error); GUI::MessageBox::show(window(), "Unable to save file.\n", "Error", GUI::MessageBox::Type::Error);
} else { } else {
editor().document().set_modified(false); editor().document().set_modified(false);
// FIXME: It would be cool if this would propagate from GUI::TextDocument somehow.
window()->set_modified(false);
update_title(); update_title();
} }
return; return;