From 229a6491c7065f253087594e0292a016f369f615 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 2 Mar 2024 01:57:16 +0100 Subject: [PATCH] ImGui: always rebuild summary text on input text change This fixes corner case bugs like selecting currently entered text, and deleting it at once. If we happen to show a ConVar's value, and do the mentioned action, it wouldn't clear it as "if (iData->BufTextLen)" won't satisfy. --- src/gameui/IConsole.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gameui/IConsole.cpp b/src/gameui/IConsole.cpp index d7c342b7..2eed165c 100644 --- a/src/gameui/IConsole.cpp +++ b/src/gameui/IConsole.cpp @@ -1037,9 +1037,8 @@ int CConsole::TextEditCallback(ImGuiInputTextCallbackData* iData) iData->DeleteChars(0, 1); } - if (iData->BufTextLen) // Attempt to build a summary.. + if (iData->BufTextLen) { - BuildSummaryText(iData->Buf); m_canAutoComplete = true; } else // Reset state and enable history scrolling when buffer is empty. @@ -1047,6 +1046,7 @@ int CConsole::TextEditCallback(ImGuiInputTextCallbackData* iData) ResetAutoCompleteData(); } + BuildSummaryText(iData->Buf); break; } }