diff --git a/Userland/DevTools/GMLPlayground/MainWidget.cpp b/Userland/DevTools/GMLPlayground/MainWidget.cpp index ca44ef0d5b..95cf474044 100644 --- a/Userland/DevTools/GMLPlayground/MainWidget.cpp +++ b/Userland/DevTools/GMLPlayground/MainWidget.cpp @@ -221,7 +221,7 @@ ErrorOr 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, diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 53313c9713..20d9e1ae2d 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -1798,9 +1798,9 @@ void TextEditor::insert_at_cursor_or_replace_selection(StringView text) } } -void TextEditor::replace_all_text_without_resetting_undo_stack(StringView text) +void TextEditor::replace_all_text_without_resetting_undo_stack(StringView text, StringView action_text) { - execute(text, "GML Playground Format Text"); + execute(text, action_text); did_change(); update(); } diff --git a/Userland/Libraries/LibGUI/TextEditor.h b/Userland/Libraries/LibGUI/TextEditor.h index 2a310027df..02d60853df 100644 --- a/Userland/Libraries/LibGUI/TextEditor.h +++ b/Userland/Libraries/LibGUI/TextEditor.h @@ -138,7 +138,7 @@ public: TextRange normalized_selection() const { return m_selection.normalized(); } void insert_at_cursor_or_replace_selection(StringView); - void replace_all_text_without_resetting_undo_stack(StringView text); + void replace_all_text_without_resetting_undo_stack(StringView text, StringView action_text); ErrorOr write_to_file(StringView path); ErrorOr write_to_file(Core::File&); bool has_selection() const { return m_selection.is_valid(); }