update cursor when Undo and Redo