1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 00:48:11 +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:
Andreas Kling 2019-11-23 17:41:14 +01:00
parent 9a157b5e81
commit fc14bdd442
4 changed files with 36 additions and 16 deletions

View file

@ -36,6 +36,7 @@ public:
virtual void document_did_remove_line(int) = 0;
virtual void document_did_remove_all_lines() = 0;
virtual void document_did_change() = 0;
virtual void document_did_set_text() = 0;
};
static NonnullRefPtr<GTextDocument> create(Client* client = nullptr)
@ -90,6 +91,7 @@ private:
Vector<GTextDocumentSpan> m_spans;
HashTable<Client*> m_clients;
bool m_client_notifications_enabled { true };
};
class GTextDocumentLine {