mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
GTextEditor: Clear current selection, if any, on set_document()
This commit is contained in:
parent
5c2ef01f7b
commit
51262e7e2d
Notes:
sideshowbarker
2024-07-19 10:58:25 +09:00
Author: https://github.com/gootik Commit: https://github.com/SerenityOS/serenity/commit/51262e7e2d5 Pull-request: https://github.com/SerenityOS/serenity/pull/835
1 changed files with 2 additions and 0 deletions
|
@ -1409,6 +1409,8 @@ void GTextEditor::set_document(GTextDocument& document)
|
|||
m_line_visual_data.append(make<LineVisualData>());
|
||||
}
|
||||
m_cursor = { 0, 0 };
|
||||
if (has_selection())
|
||||
m_selection.clear();
|
||||
recompute_all_visual_lines();
|
||||
update();
|
||||
m_document->register_client(*this);
|
||||
|
|
Loading…
Add table
Reference in a new issue