Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Clear active copilot suggestion only if there is one
Antonio Scandurrab88aa9af1de4
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rsindex 0d365aee506..7a8293e1952 100644--- a/crates/editor/src/editor.rs+++ b/crates/editor/src/editor.rs@@ -2922,9 +2922,11 @@ impl Editor {fn refresh_active_copilot_suggestion(&mut self, cx: &mut ViewContext<Self>) {let snapshot = self.buffer.read(cx).snapshot(cx);let cursor = self.selections.newest_anchor().head();+if self.context_menu.is_some() {self.display_map.update(cx, |map, cx| map.replace_suggestion::<usize>(None, cx));+ cx.notify();} else if let Some(text) = self.copilot_state.text_for_active_completion(cursor, &snapshot)@@ -2938,11 +2940,12 @@ impl Editor {cx,)});- } else {+ cx.notify();+ } else if self.has_active_copilot_suggestion(cx) {self.display_map.update(cx, |map, cx| map.replace_suggestion::<usize>(None, cx));+ cx.notify();}- cx.notify();}fn accept_copilot_suggestion(&mut self, cx: &mut ViewContext<Self>) -> bool {