mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Cancel inline assist editor on blur if it wasn't confirmed (#12684)
Release Notes: - N/A
This commit is contained in:
parent
3587e9726b
commit
7a05db6d3d
@ -697,10 +697,18 @@ impl InlineAssistEditor {
|
||||
event: &EditorEvent,
|
||||
cx: &mut ViewContext<Self>,
|
||||
) {
|
||||
if let EditorEvent::Edited = event {
|
||||
match event {
|
||||
EditorEvent::Edited => {
|
||||
self.pending_prompt = self.prompt_editor.read(cx).text(cx);
|
||||
cx.notify();
|
||||
}
|
||||
EditorEvent::Blurred => {
|
||||
if !self.confirmed {
|
||||
cx.emit(InlineAssistEditorEvent::Canceled);
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_codegen_changed(&mut self, _: Model<Codegen>, cx: &mut ViewContext<Self>) {
|
||||
|
Loading…
Reference in New Issue
Block a user