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:
parent
c9c5eef8f2
commit
8841d6faad
2 changed files with 24 additions and 5 deletions
|
@ -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)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue