move_forward/backward with input modification/restoring.