mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 21:00:06 +00:00
Previously, this was reimplementing the same thing by removing all the document text and then inserting the new text - which internally would insert each code-point individually and fire change notifications for each one. This made the "Reformat GML" button very slow, since it not only had to recalculate the visual lines of the document each time, but also rebuild the preview GUI. The reason not to use `set_text()` is that it would throw away the undo stack, since it always behaved as if the text is a new document. So, let's add a parameter to disable that behaviour. This takes the time for reformatting a ~200 line GML file from several seconds, to basically instantaneous. :^)
48 KiB
48 KiB