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 18929bd commit 6982ce4
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 @@ -4900,8 +4900,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 6982ce4

Please sign in to comment.