Restore redo selection history clearing when adding a selection to history

Issue #2305