summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r--indra/llui/lltexteditor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index b860f0b44f..144b6960a1 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1960,9 +1960,13 @@ void LLTextEditor::showContextMenu(S32 x, S32 y)
if (hasSelection())
{
if ( (mCursorPos < llmin(mSelectionStart, mSelectionEnd)) || (mCursorPos > llmax(mSelectionStart, mSelectionEnd)) )
+ {
deselect();
+ }
else
+ {
setCursorPos(llmax(mSelectionStart, mSelectionEnd));
+ }
}
bool use_spellcheck = getSpellCheck(), is_misspelled = false;