Bug fix:
1. Fix a game crash when range selecting text under certain condition.
2. Fix a bug that causing the selecting texts were mismatched with what is actually selecting under certain condition.
3. Fix a bug that causing selecting texts won't be replaced by the typed character.
