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

Function STB_TEXTEDIT_DELETECHARS

KBotExt/imgui/imgui_widgets.cpp:3745–3759  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3743#define STB_TEXTEDIT_MOVEWORDRIGHT STB_TEXTEDIT_MOVEWORDRIGHT_IMPL
3744
3745 static void STB_TEXTEDIT_DELETECHARS(ImGuiInputTextState* obj, int pos, int n)
3746 {
3747 ImWchar* dst = obj->TextW.Data + pos;
3748
3749 // We maintain our buffer length in both UTF-8 and wchar formats
3750 obj->Edited = true;
3751 obj->CurLenA -= ImTextCountUtf8BytesFromStr(dst, dst + n);
3752 obj->CurLenW -= n;
3753
3754 // Offset remaining text (FIXME-OPT: Use memmove)
3755 const ImWchar* src = obj->TextW.Data + pos + n;
3756 while (ImWchar c = *src++)
3757 *dst++ = c;
3758 *dst = '\0';
3759 }
3760
3761 static bool STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const ImWchar* new_text, int new_text_len)
3762 {

Callers 5

stb_textedit_deleteFunction · 0.85
stb_textedit_keyFunction · 0.85
stb_text_undoFunction · 0.85
stb_text_redoFunction · 0.85
stb_textedit_replaceFunction · 0.85

Calls 1

Tested by

no test coverage detected