diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 68dff0002e..1e6256ec1b 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -1220,8 +1220,9 @@ String TextEditor::selected_text() const void TextEditor::delete_selection() { auto selection = normalized_selection(); - execute(selected_text(), selection); + auto selected = selected_text(); m_selection.clear(); + execute(selected, selection); did_update_selection(); did_change(); set_cursor(selection.start());