fix(view): suppress W10 warning when nvim is launched with -R
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
This commit is contained in:
parent
c6b4a7a07b
commit
ca834cf703
1 changed files with 1 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue