1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibGUI+GMLPlayground: Set correct undo text for ReplaceAllTextCommand

- Make the text a parameter instead of forcing it to be about GML.
- Change the wording to be imperative, and match the action text.
This commit is contained in:
Sam Atkins 2023-07-26 17:37:55 +01:00 committed by Tim Flynn
parent 1d7d194062
commit 988130a935
3 changed files with 4 additions and 4 deletions

View file

@ -221,7 +221,7 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
auto format_gml_action = GUI::Action::create("&Format GML", { Mod_Ctrl | Mod_Shift, Key_I }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/reformat.png"sv)), [&](auto&) {
auto formatted_gml_or_error = GUI::GML::format_gml(m_editor->text());
if (!formatted_gml_or_error.is_error()) {
m_editor->replace_all_text_without_resetting_undo_stack(formatted_gml_or_error.release_value());
m_editor->replace_all_text_without_resetting_undo_stack(formatted_gml_or_error.release_value(), "Format GML"sv);
} else {
GUI::MessageBox::show(
&window,