From 7817bb5e6d2cfd455872a1e6f668a7d55fa429f2 Mon Sep 17 00:00:00 2001 From: Cinders Date: Sat, 23 Nov 2013 22:18:40 -0700 Subject: [PATCH] Use new selectByCursorPosition method to highlight autocompletion. --- indra/newview/fsfloaternearbychat.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/indra/newview/fsfloaternearbychat.cpp b/indra/newview/fsfloaternearbychat.cpp index b4c71260eb..156917800e 100644 --- a/indra/newview/fsfloaternearbychat.cpp +++ b/indra/newview/fsfloaternearbychat.cpp @@ -808,7 +808,7 @@ void FSFloaterNearbyChat::onChatBoxKeystroke() // Select to end of line, starting from the character // after the last one the user typed. - mInputEditor->selectNext(rest_of_match, false); + mInputEditor->selectByCursorPosition(utf8_out_str.size()-rest_of_match.size(),utf8_out_str.size()); } } else if (matchChatTypeTrigger(utf8_trigger, &utf8_out_str)) @@ -935,9 +935,7 @@ void FSFloaterNearbyChat::onChatBoxKeystroke() if (!rest_of_match.empty()) { mInputEditor->setText(prefix + replaced_text + suffix); - // *HACK: I don't know how to select text in a textbox. :( - mInputEditor->setCursorPos(prefix.size()); - mInputEditor->selectNext((rest_of_match + " "), false); + mInputEditor->selectByCursorPosition(prefix.size(), (rest_of_match.size() + 1)); } } }