From 024f438ce539d627717e4793479c8b727e8df29b Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 10 Nov 2023 16:46:06 +0400 Subject: [PATCH] Fix modifications tracking in Ui::Text::String. --- ui/text/text.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/text/text.cpp b/ui/text/text.cpp index 95f10cb..367134c 100644 --- a/ui/text/text.cpp +++ b/ui/text/text.cpp @@ -787,7 +787,8 @@ bool String::removeSkipBlock() { void String::insertModifications(int position, int delta) { auto &modifications = ensureExtended()->modifications; auto i = end(modifications); - while (i != begin(modifications) && (--i)->position >= position) { + while (i != begin(modifications) && (i - 1)->position >= position) { + --i; if (i->position < position) { break; } else if (delta > 0) {