From ca834cf70354de0fc4020d0db4ecb61efeec626d Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 20 Feb 2026 20:23:24 -0500 Subject: [PATCH] fix(view): suppress W10 warning when nvim is launched with -R MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: when Neovim is started with -R (read-only), all buffers get readonly=true. Oil's render_buffer toggles modifiable to write directory listings, which triggers "W10: Warning: Changing a readonly file" on every directory navigation. Solution: clear readonly on oil buffers during initialization. Oil buffers are buftype=acwrite — readonly has no meaning for them since writes go through BufWriteCmd, not the filesystem. Resolves: stevearc/oil.nvim#642 --- lua/oil/view.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/oil/view.lua b/lua/oil/view.lua index ba67543..973b949 100644 --- a/lua/oil/view.lua +++ b/lua/oil/view.lua @@ -384,6 +384,7 @@ M.initialize = function(bufnr) group = "Oil", }) vim.bo[bufnr].buftype = "acwrite" + vim.bo[bufnr].readonly = false vim.bo[bufnr].swapfile = false vim.bo[bufnr].syntax = "oil" vim.bo[bufnr].filetype = "oil"