Skip to content

Commit

Permalink
fix first undo group
Browse files Browse the repository at this point in the history
  • Loading branch information
scheffle committed Mar 22, 2024
1 parent 5ae734e commit 385bfec
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 @@ -2724,10 +2724,12 @@ void TextEditorView::setFindString (String&& text) const
void TextEditorView::checkCurrentUndoGroup (bool force) const
{
auto currentTime = getPlatformFactory ().getTicks ();
if (force || md.currentUndoGroup.time < currentTime - 500)
if (force || (md.currentUndoGroup.time > 0 && md.currentUndoGroup.time < currentTime - 500))
{
if (md.currentUndoGroup.record.empty ())
return;
if (md.currentUndoGroup.time == 0)
md.currentUndoGroup.time = currentTime;
md.undoList.emplace_back (std::move (md.currentUndoGroup));
md.undoPos = md.undoList.end ();
--md.undoPos;
Expand Down

0 comments on commit 385bfec

Please sign in to comment.