Skip to content

Commit

Permalink
InputText: fixed badly broken clipboard copy/bug (#8254, #8242)
Browse files Browse the repository at this point in the history
Broken by 32f1140
  • Loading branch information
ocornut committed Dec 22, 2024
1 parent 5413a9a commit eb642a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4906,8 +4906,8 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
const int ib = state->HasSelection() ? ImMin(state->Stb->select_start, state->Stb->select_end) : 0;
const int ie = state->HasSelection() ? ImMax(state->Stb->select_start, state->Stb->select_end) : state->TextLen;
g.TempBuffer.reserve(ie - ib + 1);
memcpy(g.TempBuffer.Data, state->TextSrc, ie - ib);
g.TempBuffer.Data[ie] = 0;
memcpy(g.TempBuffer.Data, state->TextSrc + ib, ie - ib);
g.TempBuffer.Data[ie - ib] = 0;
SetClipboardText(g.TempBuffer.Data);
}
if (is_cut)
Expand Down

0 comments on commit eb642a9

Please sign in to comment.