mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 13:35:49 +02:00
InputText: ImGuiInputTextCallbackData::InsertChars() accept (NULL,NULL) range, in order to conform to common idioms. (#6565, #6566, #3615)
This commit is contained in:
@ -3873,6 +3873,10 @@ void ImGuiInputTextCallbackData::DeleteChars(int pos, int bytes_count)
|
||||
|
||||
void ImGuiInputTextCallbackData::InsertChars(int pos, const char* new_text, const char* new_text_end)
|
||||
{
|
||||
// Accept null ranges
|
||||
if (new_text == new_text_end)
|
||||
return;
|
||||
|
||||
const bool is_resizable = (Flags & ImGuiInputTextFlags_CallbackResize) != 0;
|
||||
const int new_text_len = new_text_end ? (int)(new_text_end - new_text) : (int)strlen(new_text);
|
||||
if (new_text_len + BufTextLen >= BufSize)
|
||||
|
Reference in New Issue
Block a user