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.

edit prediction: Don't show and discard completion if toggled off in the buffer (#24927)

itsaphel191a1d7b1065
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 6f5432ccd2c..2f80d80d267 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -1953,7 +1953,12 @@ impl Editor {
cx: &mut Context<Self>,
) {
self.show_inline_completions_override = show_edit_predictions;
- self.refresh_inline_completion(false, true, window, cx);
+
+ if let Some(false) = show_edit_predictions {
+ self.discard_inline_completion(false, cx);
+ } else {
+ self.refresh_inline_completion(false, true, window, cx);
+ }
}
fn inline_completions_disabled_in_scope(