Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix possibility of infinite loop in selections_with_autoclose_regions

Max Brunsfeld655c9ece2dec
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 7aca4ab98ff..d7557230858 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -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;
}
}