LibGUI: Clear GUI::TextEditor selection before performing undo/redo
Fixes #6972.
This commit is contained in:
parent
194a90884c
commit
fbe6c275c9
Notes:
sideshowbarker
2024-07-18 18:28:32 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/fbe6c275c93
2 changed files with 14 additions and 2 deletions
|
@ -1820,4 +1820,16 @@ void TextEditor::set_ruler_visible(bool visible)
|
|||
update();
|
||||
}
|
||||
|
||||
void TextEditor::undo()
|
||||
{
|
||||
clear_selection();
|
||||
document().undo();
|
||||
}
|
||||
|
||||
void TextEditor::redo()
|
||||
{
|
||||
clear_selection();
|
||||
document().redo();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -130,8 +130,8 @@ public:
|
|||
void do_delete();
|
||||
void delete_current_line();
|
||||
void select_all();
|
||||
virtual void undo() { document().undo(); }
|
||||
virtual void redo() { document().redo(); }
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
Function<void()> on_change;
|
||||
Function<void(bool modified)> on_modified_change;
|
||||
|
|
Loading…
Add table
Reference in a new issue