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

LibGUI+GMLPlayground: Replace text using ReplaceAllTextCommand

This commit is contained in:
SimonFJ20 2022-04-12 22:46:26 +02:00 committed by Andreas Kling
parent 343d699627
commit 661e7d691e
5 changed files with 65 additions and 1 deletions

View file

@ -227,7 +227,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(edit_menu->try_add_action(GUI::Action::create("&Format GML", { Mod_Ctrl | Mod_Shift, Key_I }, [&](auto&) {
auto formatted_gml_or_error = GUI::GML::format_gml(editor->text());
if (!formatted_gml_or_error.is_error()) {
editor->set_text(formatted_gml_or_error.release_value());
editor->replace_all_text_while_keeping_undo_stack(formatted_gml_or_error.release_value());
} else {
GUI::MessageBox::show(
window,