1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix nick completion

This commit is contained in:
PilzAdam 2013-03-25 19:13:25 +01:00
parent 76b86c0368
commit b0e6806077
7 changed files with 21 additions and 18 deletions

View file

@ -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);