| 1187 | } |
| 1188 | |
| 1189 | static STB_TEXTEDIT_CHARTYPE* stb_text_createundo(StbUndoState* state, int pos, int insert_len, int delete_len) |
| 1190 | { |
| 1191 | StbUndoRecord* r = stb_text_create_undo_record(state, insert_len); |
| 1192 | if (r == NULL) |
| 1193 | return NULL; |
| 1194 | |
| 1195 | r->where = pos; |
| 1196 | r->insert_length = (STB_TEXTEDIT_POSITIONTYPE)insert_len; |
| 1197 | r->delete_length = (STB_TEXTEDIT_POSITIONTYPE)delete_len; |
| 1198 | |
| 1199 | if (insert_len == 0) { |
| 1200 | r->char_storage = -1; |
| 1201 | return NULL; |
| 1202 | } |
| 1203 | else { |
| 1204 | r->char_storage = state->undo_char_point; |
| 1205 | state->undo_char_point += insert_len; |
| 1206 | return &state->undo_char[r->char_storage]; |
| 1207 | } |
| 1208 | } |
| 1209 | |
| 1210 | static void stb_text_undo(STB_TEXTEDIT_STRING* str, STB_TexteditState* state) |
| 1211 | { |
no test coverage detected