]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/chat.cpp
Right mouse button behaviour for craft/inventory If right mousebutton clicked once...
[dragonfireclient.git] / src / chat.cpp
index 1135ccdf7486be295043e659a1d0685edcd241ea..0466b6e263e082929e959fa39d1b5277847997dd 100644 (file)
@@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "chat.h"
 #include "debug.h"
-#include <cassert>
+#include "strfnd.h"
 #include <cctype>
 #include <sstream>
 #include "util/string.h"
@@ -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
@@ -464,7 +464,7 @@ void ChatPrompt::historyNext()
        }
 }
 
-void ChatPrompt::nickCompletion(const std::list<std::wstring>& names, bool backwards)
+void ChatPrompt::nickCompletion(const std::list<std::string>& names, bool backwards)
 {
        // Two cases:
        // (a) m_nick_completion_start == m_nick_completion_end == 0
@@ -493,13 +493,13 @@ void ChatPrompt::nickCompletion(const std::list<std::wstring>& names, bool backw
 
        // find all names that start with the selected prefix
        std::vector<std::wstring> completions;
-       for (std::list<std::wstring>::const_iterator
+       for (std::list<std::string>::const_iterator
                        i = names.begin();
                        i != names.end(); ++i)
        {
-               if (str_starts_with(*i, prefix, true))
+               if (str_starts_with(narrow_to_wide(*i), prefix, true))
                {
-                       std::wstring completion = *i;
+                       std::wstring completion = narrow_to_wide(*i);
                        if (prefix_start == 0)
                                completion += L":";
                        completions.push_back(completion);