Skip to content

Commit

Permalink
Fix paste failure handling breaking undo stack (could lead to freezes) (
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Jul 5, 2021
1 parent 8e51be0 commit cb5d5d7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions stb_textedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,9 +708,7 @@ static int stb_textedit_paste_internal(STB_TEXTEDIT_STRING *str, STB_TexteditSta
state->has_preferred_x = 0;
return 1;
}
// remove the undo since we didn't actually insert the characters
if (state->undostate.undo_point)
--state->undostate.undo_point;
// note: paste failure will leave deleted selection, may be restored with an undo (see https://github.com/nothings/stb/issues/734 for details)
return 0;
}

Expand Down

0 comments on commit cb5d5d7

Please sign in to comment.