From 66d9c5f790dbc8eb86cb63277a67291e7f6fce8a Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 30 Aug 2015 10:00:13 +0200 Subject: [PATCH] reset tab completion just in case of manipulation. #1340 --- src/game/client/components/chat.cpp | 13 +++++++------ src/game/client/lineinput.cpp | 4 ++-- src/game/client/lineinput.h | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index d3f19bd47..ebd1a9f7a 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -212,13 +212,14 @@ bool CChat::OnInput(IInput::CEvent Event) } else { - // reset name completion process - if(Event.m_Flags&IInput::FLAG_PRESS && Event.m_Key != KEY_TAB) - m_CompletionChosen = -1; - m_OldChatStringLength = m_Input.GetLength(); - m_Input.ProcessInput(Event); - m_InputUpdate = true; + if(m_Input.ProcessInput(Event)) + { + m_InputUpdate = true; + + // reset name completion process + m_CompletionChosen = -1; + } } if(Event.m_Flags&IInput::FLAG_PRESS && Event.m_Key == KEY_UP) { diff --git a/src/game/client/lineinput.cpp b/src/game/client/lineinput.cpp index 11fae570b..3dcdff7a4 100644 --- a/src/game/client/lineinput.cpp +++ b/src/game/client/lineinput.cpp @@ -102,7 +102,7 @@ bool CLineInput::Manipulate(IInput::CEvent e, char *pStr, int StrMaxSize, int St return Changes; } -void CLineInput::ProcessInput(IInput::CEvent e) +bool CLineInput::ProcessInput(IInput::CEvent e) { - Manipulate(e, m_Str, MAX_SIZE, MAX_CHARS, &m_Len, &m_CursorPos, &m_NumChars); + return Manipulate(e, m_Str, MAX_SIZE, MAX_CHARS, &m_Len, &m_CursorPos, &m_NumChars); } diff --git a/src/game/client/lineinput.h b/src/game/client/lineinput.h index 32b2dccd5..5e1f1d74d 100644 --- a/src/game/client/lineinput.h +++ b/src/game/client/lineinput.h @@ -29,7 +29,7 @@ public: CLineInput(); void Clear(); - void ProcessInput(IInput::CEvent e); + bool ProcessInput(IInput::CEvent e); void Set(const char *pString); const char *GetString() const { return m_Str; } int GetLength() const { return m_Len; }