mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-29 13:53:04 +03:00
Fix possibility of infinite loop in selections_with_autoclose_regions
Previously, that method could loop forever if the editor's autoclose regions had unexpected selection ids. Co-authored-by: Piotr <piotr@zed.dev>
This commit is contained in:
parent
4e68b588be
commit
655c9ece2d
@ -3286,8 +3286,10 @@ impl Editor {
|
|||||||
i = 0;
|
i = 0;
|
||||||
} else if pair_state.range.start.to_offset(buffer) > range.end {
|
} else if pair_state.range.start.to_offset(buffer) > range.end {
|
||||||
break;
|
break;
|
||||||
} else if pair_state.selection_id == selection.id {
|
} else {
|
||||||
enclosing = Some(pair_state);
|
if pair_state.selection_id == selection.id {
|
||||||
|
enclosing = Some(pair_state);
|
||||||
|
}
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user