Skip to content

Commit b311dcc

Browse files
committed
Preserve trailing newline when processing truncated content
1 parent 2b565dd commit b311dcc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/vscode/src/commands/apply-chat-response-command/handlers/truncated-handler.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,13 @@ function process_truncated_content(
230230
}
231231
}
232232

233-
return output_lines.join('\n')
233+
const result = output_lines.join('\n')
234+
235+
if (original_text.endsWith('\n') && !result.endsWith('\n')) {
236+
return result + '\n'
237+
}
238+
239+
return result
234240
}
235241

236242
function find_line_sequence(

0 commit comments

Comments
 (0)