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,9 +697,17 @@ impl InlineAssistEditor {
|
|||||||
event: &EditorEvent,
|
event: &EditorEvent,
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) {
|
) {
|
||||||
if let EditorEvent::Edited = event {
|
match event {
|
||||||
self.pending_prompt = self.prompt_editor.read(cx).text(cx);
|
EditorEvent::Edited => {
|
||||||
cx.notify();
|
self.pending_prompt = self.prompt_editor.read(cx).text(cx);
|
||||||
|
cx.notify();
|
||||||
|
}
|
||||||
|
EditorEvent::Blurred => {
|
||||||
|
if !self.confirmed {
|
||||||
|
cx.emit(InlineAssistEditorEvent::Canceled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user