Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

copilot: Propagate action if suggest_next is not possible. (#3129)

Piotr Osiewicz6f4008ebabd3
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index bb6d693d825..7aca4ab98ff 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -4158,7 +4158,10 @@ impl Editor {
if self.has_active_copilot_suggestion(cx) {
self.cycle_copilot_suggestions(Direction::Next, cx);
} else {
- self.refresh_copilot_suggestions(false, cx);
+ let is_copilot_disabled = self.refresh_copilot_suggestions(false, cx).is_none();
+ if is_copilot_disabled {
+ cx.propagate_action();
+ }
}
}
@@ -4170,7 +4173,10 @@ impl Editor {
if self.has_active_copilot_suggestion(cx) {
self.cycle_copilot_suggestions(Direction::Prev, cx);
} else {
- self.refresh_copilot_suggestions(false, cx);
+ let is_copilot_disabled = self.refresh_copilot_suggestions(false, cx).is_none();
+ if is_copilot_disabled {
+ cx.propagate_action();
+ }
}
}