MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / stb_text_createundo

Function stb_text_createundo

KBotExt/imgui/imstb_textedit.h:1189–1208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1187}
1188
1189static 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
1210static void stb_text_undo(STB_TEXTEDIT_STRING* str, STB_TexteditState* state)
1211{

Calls 1

Tested by

no test coverage detected