fix bug that sometimes getting wrong vim cursor