Fix a bug about text after cursor