mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
LibGUI: Don't recompute line-wrapping over and over during set_text()
This makes the TextEditor start up fast for large files again.
This commit is contained in:
@@ -1613,6 +1613,14 @@ void GTextEditor::document_did_change()
|
||||
update();
|
||||
}
|
||||
|
||||
void GTextEditor::document_did_set_text()
|
||||
{
|
||||
m_line_visual_data.clear();
|
||||
for (int i = 0; i < m_document->line_count(); ++i)
|
||||
m_line_visual_data.append(make<LineVisualData>());
|
||||
document_did_change();
|
||||
}
|
||||
|
||||
void GTextEditor::set_document(GTextDocument& document)
|
||||
{
|
||||
if (m_document.ptr() == &document)
|
||||
|
||||
Reference in New Issue
Block a user