fix cursor positioning on OS X when CJK characters are present