Fix possibility of infinite loop in selections_with_autoclose_regions (#3138)
Max Brunsfeld
created
Previously, that method could loop forever if the editor's autoclose
regions had unexpected selection ids.
Something must have changed recently that allowed this invariant to be
violated, but regardless, this code should not have relied on that
invariant to terminate like this.