From 3d6b0a2d203d1ea82993dcf3fc20dc2d813cec24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Wed, 8 Jan 2020 11:00:56 +0100 Subject: [PATCH] [escher/text_field] Fix selection deletion The draft text length should be modified accordingly --- escher/src/text_field.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/escher/src/text_field.cpp b/escher/src/text_field.cpp index 952c3090d..f84d83bf5 100644 --- a/escher/src/text_field.cpp +++ b/escher/src/text_field.cpp @@ -233,6 +233,8 @@ size_t TextField::ContentView::deleteSelection() { * are invalid */ m_selectionStart = nullptr; m_selectionEnd = nullptr; + assert(removedLength <= m_currentDraftTextLength); + m_currentDraftTextLength -= removedLength; return removedLength; }