fix segmentation on CJK characters when updating selection