From 28b901a9a6e720785799f5021fb87c7970c00675 Mon Sep 17 00:00:00 2001 From: scheffle Date: Sat, 6 Apr 2024 18:25:31 +0200 Subject: [PATCH] fix deleting a character with VIRT_DELETE key --- vstgui/lib/ctexteditor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vstgui/lib/ctexteditor.cpp b/vstgui/lib/ctexteditor.cpp index 569e9362e..a7d06580c 100644 --- a/vstgui/lib/ctexteditor.cpp +++ b/vstgui/lib/ctexteditor.cpp @@ -2070,8 +2070,10 @@ bool TextEditorView::callSTB (Proc proc) const { md.stbInternalIterator = md.model.lines.begin (); auto oldState = md.editState; + auto oldTextLength = md.model.text.length (); proc (); - if (memcmp (&oldState, &md.editState, sizeof (STB_TexteditState)) != 0) + if (oldTextLength != md.model.text.length () || + memcmp (&oldState, &md.editState, sizeof (STB_TexteditState)) != 0) { if (oldState.select_start != md.editState.select_start || oldState.select_end != md.editState.select_end)