mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
tiny style changes
This commit is contained in:
parent
141a256cb3
commit
9af59fe8f3
|
@ -166,11 +166,11 @@ bool CChat::OnInput(IInput::CEvent Event)
|
|||
int FoundAt = SearchDirection > 0 ? m_Input.GetLength() - 1 : 0;
|
||||
for(int i = m_Input.GetCursorOffset() + SearchDirection; SearchDirection > 0 ? i < m_Input.GetLength() - 1 : i > 0; i += SearchDirection)
|
||||
{
|
||||
int next = i + SearchDirection;
|
||||
if( (m_Input.GetString()[next] == ' ') ||
|
||||
(m_Input.GetString()[next] >= 32 && m_Input.GetString()[next] <= 47) ||
|
||||
(m_Input.GetString()[next] >= 58 && m_Input.GetString()[next] <= 64) ||
|
||||
(m_Input.GetString()[next] >= 91 && m_Input.GetString()[next] <= 96))
|
||||
int Next = i + SearchDirection;
|
||||
if( (m_Input.GetString()[Next] == ' ') ||
|
||||
(m_Input.GetString()[Next] >= 32 && m_Input.GetString()[Next] <= 47) ||
|
||||
(m_Input.GetString()[Next] >= 58 && m_Input.GetString()[Next] <= 64) ||
|
||||
(m_Input.GetString()[Next] >= 91 && m_Input.GetString()[Next] <= 96))
|
||||
{
|
||||
FoundAt = i;
|
||||
if (SearchDirection < 0)
|
||||
|
@ -182,13 +182,13 @@ bool CChat::OnInput(IInput::CEvent Event)
|
|||
{
|
||||
if(m_Input.GetCursorOffset() != 0)
|
||||
{
|
||||
char Text[512];
|
||||
str_copy(Text, m_Input.GetString(), FoundAt + 1);
|
||||
char aText[512];
|
||||
str_copy(aText, m_Input.GetString(), FoundAt + 1);
|
||||
|
||||
if(m_Input.GetCursorOffset() != str_length(m_Input.GetString()))
|
||||
str_append(Text, m_Input.GetString() + m_Input.GetCursorOffset(), str_length(m_Input.GetString()));
|
||||
str_append(aText, m_Input.GetString() + m_Input.GetCursorOffset(), str_length(m_Input.GetString()));
|
||||
|
||||
m_Input.Set(Text);
|
||||
m_Input.Set(aText);
|
||||
}
|
||||
}
|
||||
m_Input.SetCursorOffset(FoundAt);
|
||||
|
|
Loading…
Reference in a new issue