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.

Diff lines one chunk at a time after discovering indentation

Antonio Scandurra127d03516fb4
diff --git a/crates/ai/src/codegen.rs b/crates/ai/src/codegen.rs
index bc13e294fa8..e7da46cdf95 100644
--- a/crates/ai/src/codegen.rs
+++ b/crates/ai/src/codegen.rs
@@ -225,10 +225,13 @@ impl Codegen {
}
}
- if lines.peek().is_some() {
+ if line_indent.is_some() {
hunks_tx.send(diff.push_new(&new_text)).await?;
- hunks_tx.send(diff.push_new("\n")).await?;
new_text.clear();
+ }
+
+ if lines.peek().is_some() {
+ hunks_tx.send(diff.push_new("\n")).await?;
line_indent = None;
first_line = false;
}