diff --git a/crates/assistant/src/slash_command/default_command.rs b/crates/assistant/src/slash_command/default_command.rs index 56c3a4499796d6ce5bbc65a2e40ab74de5d1d37e..bd26b724c94c16383e9b4423ca914f3b5e7fa248 100644 --- a/crates/assistant/src/slash_command/default_command.rs +++ b/crates/assistant/src/slash_command/default_command.rs @@ -53,7 +53,7 @@ impl SlashCommand for DefaultSlashCommand { let prompts = store.default_prompt_metadata(); let mut text = String::new(); - writeln!(text, "Default Prompt:").unwrap(); + text.push('\n'); for prompt in prompts { if let Some(title) = prompt.title { writeln!(text, "/prompt {}", title).unwrap(); @@ -61,6 +61,10 @@ impl SlashCommand for DefaultSlashCommand { } text.pop(); + if text.is_empty() { + text.push('\n'); + } + Ok(SlashCommandOutput { sections: vec![SlashCommandOutputSection { range: 0..text.len(), diff --git a/crates/assistant/src/slash_command/prompt_command.rs b/crates/assistant/src/slash_command/prompt_command.rs index 3e3041e17001d9af4a27a52a2c7693cbeed25752..21e22fd837200af9fa1ea4413e391a58fa3c5007 100644 --- a/crates/assistant/src/slash_command/prompt_command.rs +++ b/crates/assistant/src/slash_command/prompt_command.rs @@ -69,7 +69,10 @@ impl SlashCommand for PromptSlashCommand { } }); cx.foreground_executor().spawn(async move { - let prompt = prompt.await?; + let mut prompt = prompt.await?; + if prompt.is_empty() { + prompt.push('\n'); + } let range = 0..prompt.len(); Ok(SlashCommandOutput { text: prompt,