Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Skip additional completions on any kind of overlap with primary edit
Julia44c3cedc48e5
diff --git a/crates/project/src/project.rs b/crates/project/src/project.rsindex 0675610dcb7..0e2723201a7 100644--- a/crates/project/src/project.rs+++ b/crates/project/src/project.rs@@ -3476,12 +3476,12 @@ impl Project {for (range, text) in edits {let primary = &completion.old_range;- let within_primary = primary.start.cmp(&range.start, buffer).is_ge()- && primary.end.cmp(&range.end, buffer).is_le();- let within_additional = range.start.cmp(&primary.start, buffer).is_ge()- && range.end.cmp(&primary.end, buffer).is_le();+ let start_within = primary.start.cmp(&range.start, buffer).is_le()+ && primary.end.cmp(&range.start, buffer).is_ge();+ let end_within = range.start.cmp(&primary.end, buffer).is_le()+ && range.end.cmp(&primary.end, buffer).is_ge();- if !within_primary && !within_additional {+ if !start_within && !end_within {buffer.edit([(range, text)], None, cx);}}