mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:18:11 +00:00
LibGUI: Fix crash in TextDocument::remove(TextRange)
Oops, we can't be appending substrings of a string we just deleted! Fix this by building up the new line instead of trying to clear and append in place. This works out nicely as we now do fewer document view updates when removing a range. :^)
This commit is contained in:
parent
30a3b8333a
commit
6060c7444b
2 changed files with 13 additions and 3 deletions
|
@ -160,6 +160,7 @@ public:
|
|||
const u32* codepoints() const { return m_text.data(); }
|
||||
size_t length() const { return m_text.size(); }
|
||||
void set_text(TextDocument&, const StringView&);
|
||||
void set_text(TextDocument&, Vector<u32>);
|
||||
void append(TextDocument&, u32);
|
||||
void prepend(TextDocument&, u32);
|
||||
void insert(TextDocument&, size_t index, u32);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue