FIRE-15712: Using Unicode characters in chat bar selects wrong part of the string when using nearby avatar name prediction

Ansariel 2015-03-13 21:28:50 +01:00
parent c2225763ec
commit 939214ef68
2 changed files with 2 additions and 2 deletions

View File

@ -923,7 +923,7 @@ void FSFloaterNearbyChat::onChatBoxKeystroke()
if (!rest_of_match.empty())
{
mInputEditor->setText(prefix + replaced_text + suffix);
mInputEditor->selectByCursorPosition(prefix.size() + match.size(), prefix.size() + replaced_text.size());
mInputEditor->selectByCursorPosition(utf8string_to_wstring(prefix).size() + utf8string_to_wstring(match).size(), utf8string_to_wstring(prefix).size() + utf8string_to_wstring(replaced_text).size());
}
}
}

View File

@ -277,7 +277,7 @@ void FSNearbyChatControl::onKeystroke(LLLineEditor* caller,void* userdata)
prefix += match + rest_of_match + " ";
}
caller->setText(prefix + suffix);
caller->setSelection(prefix.length(), cur_pos);
caller->setSelection(utf8str_to_wstring(prefix).length(), cur_pos);
}
}
}