Avoid redundant newline insertion after file command (#16419)

Release Notes:

- Fixed an issue where an extra newline was inserted after running a
`/file` command in the assistant.
This commit is contained in:
Max Brunsfeld 2024-08-17 15:10:10 -07:00 committed by GitHub
parent c9c5eef8f2
commit 8841d6faad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 5 deletions

View file

@ -2088,14 +2088,14 @@ impl ContextEditor {
command_range: Range<language::Anchor>,
name: &str,
arguments: &[String],
insert_trailing_newline: bool,
ensure_trailing_newline: bool,
workspace: WeakView<Workspace>,
cx: &mut ViewContext<Self>,
) {
if let Some(command) = SlashCommandRegistry::global(cx).command(name) {
let output = command.run(arguments, workspace, self.lsp_adapter_delegate.clone(), cx);
self.context.update(cx, |context, cx| {
context.insert_command_output(command_range, output, insert_trailing_newline, cx)
context.insert_command_output(command_range, output, ensure_trailing_newline, cx)
});
}
}