X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fchat.cpp;h=0466b6e263e082929e959fa39d1b5277847997dd;hb=56195dc2e45b85b7177cfa97aade77e92cff8805;hp=1135ccdf7486be295043e659a1d0685edcd241ea;hpb=6a1670dbc31cc0e44178bbd9ad34ff0d5981a060;p=oweals%2Fminetest.git diff --git a/src/chat.cpp b/src/chat.cpp index 1135ccdf7..0466b6e26 100644 --- a/src/chat.cpp +++ b/src/chat.cpp @@ -19,7 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "chat.h" #include "debug.h" -#include +#include "strfnd.h" #include #include #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& names, bool backwards) +void ChatPrompt::nickCompletion(const std::list& 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& names, bool backw // find all names that start with the selected prefix std::vector completions; - for (std::list::const_iterator + for (std::list::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);