]> git.lizzy.rs Git - minetest.git/blobdiff - src/chat.cpp
Optionally specify propagateSunlight area in calcLighting
[minetest.git] / src / chat.cpp
index 0bd5c16709bb54565f677e7d34123cd6af173608..b78b90145f2588e57d2de19fd5ad16cd2ba8e937 100644 (file)
@@ -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;