Fix a bug of smart cursor.

When adding emoticons continuously, the new em should appear after the old one, not before.