mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 21:32:40 +00:00
Remember whether include conversation was toggled
This commit is contained in:
parent
84b9c22170
commit
16422a06ad
1 changed files with 11 additions and 2 deletions
|
@ -399,6 +399,11 @@ impl AssistantPanel {
|
||||||
InlineAssistantEvent::Dismissed => {
|
InlineAssistantEvent::Dismissed => {
|
||||||
self.hide_inline_assist(assist_id, cx);
|
self.hide_inline_assist(assist_id, cx);
|
||||||
}
|
}
|
||||||
|
InlineAssistantEvent::IncludeConversationToggled {
|
||||||
|
include_conversation,
|
||||||
|
} => {
|
||||||
|
self.include_conversation_in_next_inline_assist = *include_conversation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -488,8 +493,6 @@ impl AssistantPanel {
|
||||||
include_conversation: bool,
|
include_conversation: bool,
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) {
|
) {
|
||||||
self.include_conversation_in_next_inline_assist = include_conversation;
|
|
||||||
|
|
||||||
let api_key = if let Some(api_key) = self.api_key.borrow().clone() {
|
let api_key = if let Some(api_key) = self.api_key.borrow().clone() {
|
||||||
api_key
|
api_key
|
||||||
} else {
|
} else {
|
||||||
|
@ -2833,6 +2836,9 @@ enum InlineAssistantEvent {
|
||||||
},
|
},
|
||||||
Canceled,
|
Canceled,
|
||||||
Dismissed,
|
Dismissed,
|
||||||
|
IncludeConversationToggled {
|
||||||
|
include_conversation: bool,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
|
@ -2955,6 +2961,9 @@ impl InlineAssistant {
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) {
|
) {
|
||||||
self.include_conversation = !self.include_conversation;
|
self.include_conversation = !self.include_conversation;
|
||||||
|
cx.emit(InlineAssistantEvent::IncludeConversationToggled {
|
||||||
|
include_conversation: self.include_conversation,
|
||||||
|
});
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue