Preserve mode when editing history.