Update the location info in the stack if the cursor has moved before jumping

If the cursor has moved during navigating the history, the information maintained in the stack should be updated.