fix move cursor in insert mode bug