Update copilot when we are the last task

This commit is contained in:
Julia 2023-11-22 14:03:43 -05:00
parent 9abce4bdd9
commit f0c7b3e6ee

View file

@ -3642,10 +3642,10 @@ impl Editor {
drop(context_menu); drop(context_menu);
this.discard_copilot_suggestion(cx); this.discard_copilot_suggestion(cx);
cx.notify(); cx.notify();
} else if this.completion_tasks.is_empty() { } else if this.completion_tasks.len() <= 1 {
// If there are no more completion tasks and the last menu was // If there are no more completion tasks (omitting ourself) and
// empty, we should hide it. If it was already hidden, we should // the last menu was empty, we should hide it. If it was already
// also show the copilot suggestion when available. // hidden, we should also show the copilot suggestion when available.
drop(context_menu); drop(context_menu);
if this.hide_context_menu(cx).is_none() { if this.hide_context_menu(cx).is_none() {
this.update_visible_copilot_suggestion(cx); this.update_visible_copilot_suggestion(cx);