mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-30 14:17:02 +00:00
Avoid double message header in new contexts, don't expand default prompt (#16490)
Follow-up to https://github.com/zed-industries/zed/pull/16471 * Don't expand the default prompt by default, since it looks strange in the expanded state * Don't create two `You` headers by default. Just insert a blank line after the default prompt. Release Notes: - N/A
This commit is contained in:
parent
0042c24d3c
commit
30bfa56a24
1 changed files with 2 additions and 8 deletions
|
@ -1814,24 +1814,18 @@ impl ContextEditor {
|
||||||
fn insert_default_prompt(&mut self, cx: &mut ViewContext<Self>) {
|
fn insert_default_prompt(&mut self, cx: &mut ViewContext<Self>) {
|
||||||
let command_name = DefaultSlashCommand.name();
|
let command_name = DefaultSlashCommand.name();
|
||||||
self.editor.update(cx, |editor, cx| {
|
self.editor.update(cx, |editor, cx| {
|
||||||
editor.insert(&format!("/{command_name}"), cx)
|
editor.insert(&format!("/{command_name}\n\n"), cx)
|
||||||
});
|
});
|
||||||
self.split(&Split, cx);
|
|
||||||
let command = self.context.update(cx, |context, cx| {
|
let command = self.context.update(cx, |context, cx| {
|
||||||
let first_message_id = context.messages(cx).next().unwrap().id;
|
|
||||||
context.update_metadata(first_message_id, cx, |metadata| {
|
|
||||||
metadata.role = Role::User;
|
|
||||||
});
|
|
||||||
context.reparse_slash_commands(cx);
|
context.reparse_slash_commands(cx);
|
||||||
context.pending_slash_commands()[0].clone()
|
context.pending_slash_commands()[0].clone()
|
||||||
});
|
});
|
||||||
|
|
||||||
self.run_command(
|
self.run_command(
|
||||||
command.source_range,
|
command.source_range,
|
||||||
&command.name,
|
&command.name,
|
||||||
&command.arguments,
|
&command.arguments,
|
||||||
false,
|
false,
|
||||||
true,
|
false,
|
||||||
self.workspace.clone(),
|
self.workspace.clone(),
|
||||||
cx,
|
cx,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue