X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fchat.cpp;h=b78b90145f2588e57d2de19fd5ad16cd2ba8e937;hb=7289d61e99625b46eb2c4d6b90a2a5de42f207e6;hp=0bd5c16709bb54565f677e7d34123cd6af173608;hpb=4e1f50035e860a00636ca5d804c267119df99601;p=minetest.git diff --git a/src/chat.cpp b/src/chat.cpp index 0bd5c1670..b78b90145 100644 --- a/src/chat.cpp +++ b/src/chat.cpp @@ -151,7 +151,7 @@ void ChatBuffer::reformat(u32 cols, u32 rows) } else if (cols != m_cols || rows != m_rows) { - // TODO: Avoid reformatting ALL lines (even inivisble ones) + // TODO: Avoid reformatting ALL lines (even invisible ones) // each time the console size changes. // Find out the scroll position in *unformatted* lines @@ -407,6 +407,15 @@ void ChatPrompt::input(wchar_t ch) m_nick_completion_end = 0; } +void ChatPrompt::input(const std::wstring &str) +{ + m_line.insert(m_cursor, str); + m_cursor += str.size(); + clampView(); + m_nick_completion_start = 0; + m_nick_completion_end = 0; +} + std::wstring ChatPrompt::submit() { std::wstring line = m_line;