InputText: calling ReloadUserBuf doesn't clear undo stack. (#2890)

This commit is contained in:
ocornut
2024-12-12 19:03:09 +01:00
parent 8237ab450e
commit 324d4bb140
2 changed files with 23 additions and 22 deletions
+1 -2
View File
@@ -1133,7 +1133,7 @@ struct IMGUI_API ImGuiInputTextState
bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!)
bool SelectedAllMouseLock; // after a double-click to select all, we ignore further mouse drags to update selection
bool Edited; // edited this frame
bool ReloadUserBuf; // force a reload of user buf so it may be modified externally. may be automatic in future version.
bool WantReloadUserBuf; // force a reload of user buf so it may be modified externally. may be automatic in future version.
int ReloadSelectionStart;
int ReloadSelectionEnd;
@@ -1159,7 +1159,6 @@ struct IMGUI_API ImGuiInputTextState
// strcpy(my_buf, "hello");
// if (ImGuiInputTextState* state = ImGui::GetInputTextState(id)) // id may be ImGui::GetItemID() is last item
// state->ReloadUserBufAndSelectAll();
// THIS CURRENTLY RESETS THE UNDO STACK.
void ReloadUserBufAndSelectAll();
void ReloadUserBufAndKeepSelection();
void ReloadUserBufAndMoveToEnd();