Compare commits

...

2 Commits

Author SHA1 Message Date
Max Brunsfeld
c6466c1cce Fix possibility of infinite loop in selections_with_autoclose_regions (#3138)
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.
2023-10-18 14:35:52 -04:00
Joseph T. Lyons
58dcb52336 v0.109.x preview 2023-10-18 12:30:57 -04:00
2 changed files with 5 additions and 3 deletions

View File

@@ -3286,8 +3286,10 @@ impl Editor {
i = 0;
} else if pair_state.range.start.to_offset(buffer) > range.end {
break;
} else if pair_state.selection_id == selection.id {
enclosing = Some(pair_state);
} else {
if pair_state.selection_id == selection.id {
enclosing = Some(pair_state);
}
i += 1;
}
}

View File

@@ -1 +1 @@
dev
preview