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.

editor: Disable edit predictions in read-only buffers (#26804)

Finn Evers96b747e31dde
diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs
index 94d3ac4383a..987d9e29eb2 100644
--- a/crates/editor/src/editor.rs
+++ b/crates/editor/src/editor.rs
@@ -5200,6 +5200,9 @@ impl Editor {
cx: &App,
) -> bool {
maybe!({
+ if self.read_only(cx) {
+ return Some(false);
+ }
let provider = self.edit_prediction_provider()?;
if !provider.is_enabled(&buffer, buffer_position, cx) {
return Some(false);