Correctly update selection when clearing diff