GTextEditor: Clear current selection, if any, on set_document()

This commit is contained in:
Sasan Hezarkhani 2019-12-01 18:49:13 -08:00 committed by Andreas Kling
parent 5c2ef01f7b
commit 51262e7e2d
Notes: sideshowbarker 2024-07-19 10:58:25 +09:00

View File

@ -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);