Skip to content

Commit

Permalink
fix deleting a character with VIRT_DELETE key
Browse files Browse the repository at this point in the history
  • Loading branch information
scheffle committed Apr 6, 2024
1 parent 23972ca commit 28b901a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vstgui/lib/ctexteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 28b901a

Please sign in to comment.