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.

ep: Missing newlines in teacher prompt (#47143)

Oleksiy Syvokonad7c30e539d5
diff --git a/crates/edit_prediction_cli/src/format_prompt.rs b/crates/edit_prediction_cli/src/format_prompt.rs
index 288db951854..3f00595081b 100644
--- a/crates/edit_prediction_cli/src/format_prompt.rs
+++ b/crates/edit_prediction_cli/src/format_prompt.rs
@@ -251,6 +251,7 @@ impl TeacherPrompt {
for file in related_files {
let path_str = file.path.to_string_lossy();
writeln!(&mut prompt, "`````{path_str}").ok();
+
let mut prev_row = 0;
for excerpt in &file.excerpts {
if excerpt.row_range.start > prev_row {
@@ -263,7 +264,7 @@ impl TeacherPrompt {
if prev_row < file.max_row {
prompt.push_str("…\n");
}
- prompt.push_str("\n`````");
+ prompt.push_str("\n`````\n");
}
prompt