diff --git a/crates/ferrite-core/src/buffer.rs b/crates/ferrite-core/src/buffer.rs index 3c02f2b..3183d2f 100644 --- a/crates/ferrite-core/src/buffer.rs +++ b/crates/ferrite-core/src/buffer.rs @@ -162,7 +162,7 @@ impl Buffer { metadata.permissions().readonly() }; #[cfg(unix)] - let read_only_file = nix::unistd::access(path, nix::unistd::AccessFlags::R_OK).is_ok(); + let read_only_file = !nix::unistd::access(path, nix::unistd::AccessFlags::W_OK).is_ok(); let (encoding, rope) = read::read_from_file(path)?; let mut syntax = Syntax::new(get_buffer_proxy());