HaikuDepot TextView: fix merging of spans

When adding two successive spans with identical styles, they should be
merged into a single span. However, all prevous spans in the view were
accidentally removed.

Change-Id: I4b2d21331ba97cf54a0db83e7638e23bd2303a63
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7128
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
PulkoMandy
2023-11-25 10:49:21 +00:00
committed by Adrien Destugues
parent fd76762183
commit 111528d18d
+1 -1
View File
@@ -116,7 +116,7 @@ Paragraph::Append(const TextSpan& span)
if (lastSpan.Style() == span.Style()) {
BString text(lastSpan.Text());
text.Append(span.Text());
fTextSpans.clear();
fTextSpans.pop_back();
fTextSpans.push_back(TextSpan(text, span.Style()));
return true;
}