From b513a787fb3a79d194fade61a7cb858cba411772 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 26 Oct 2019 20:21:12 +0200 Subject: [PATCH] GTextEditor: set_text() should clear any existing spans --- Libraries/LibGUI/GTextEditor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Libraries/LibGUI/GTextEditor.cpp b/Libraries/LibGUI/GTextEditor.cpp index df373af563c..a82435e6356 100644 --- a/Libraries/LibGUI/GTextEditor.cpp +++ b/Libraries/LibGUI/GTextEditor.cpp @@ -54,6 +54,8 @@ void GTextEditor::set_text(const StringView& text) if (is_single_line() && text.length() == m_lines[0].length() && !memcmp(text.characters_without_null_termination(), m_lines[0].characters(), text.length())) return; + m_spans.clear(); + m_selection.clear(); m_lines.clear(); int start_of_current_line = 0;