Index: linden/indra/llui/lllineeditor.cpp
===================================================================
--- linden/indra/llui/lllineeditor.cpp	(.../IME-20071123a)	(revision 371)
+++ linden/indra/llui/lllineeditor.cpp	(.../IME-20071124)	(revision 371)
@@ -2443,7 +2443,11 @@
 	}
 
 	// Note that call to updatePreedit is always preceeded by resetPreedit,
-	// so we have no existing selection/preedit.
+	// so we should have no existing preedit.
+	if (hasSelection())
+	{
+		deleteSelection();
+	}
 
 	S32 insert_preedit_at = getCursor();
 
Index: linden/indra/llui/lltexteditor.cpp
===================================================================
--- linden/indra/llui/lltexteditor.cpp	(.../IME-20071123a)	(revision 371)
+++ linden/indra/llui/lltexteditor.cpp	(.../IME-20071124)	(revision 371)
@@ -4414,6 +4414,13 @@
 		return;
 	}
 
+	// Note that a call to updatePreedit is always preceeded by resetPreedit,
+	// so we should have no existing preedit.
+	if (hasSelection())
+	{
+		deleteSelection(TRUE);
+	}
+
 	getWindow()->hideCursorUntilMouseMove();
 
 	S32 insert_preedit_at = mCursorPos;
