1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

LibGUI: Clear GUI::TextEditor selection before performing undo/redo

Fixes #6972.
This commit is contained in:
Andreas Kling 2021-05-08 23:38:01 +02:00
parent 194a90884c
commit fbe6c275c9
2 changed files with 14 additions and 2 deletions

View file

@ -1820,4 +1820,16 @@ void TextEditor::set_ruler_visible(bool visible)
update(); update();
} }
void TextEditor::undo()
{
clear_selection();
document().undo();
}
void TextEditor::redo()
{
clear_selection();
document().redo();
}
} }

View file

@ -130,8 +130,8 @@ public:
void do_delete(); void do_delete();
void delete_current_line(); void delete_current_line();
void select_all(); void select_all();
virtual void undo() { document().undo(); } virtual void undo();
virtual void redo() { document().redo(); } virtual void redo();
Function<void()> on_change; Function<void()> on_change;
Function<void(bool modified)> on_modified_change; Function<void(bool modified)> on_modified_change;