doc: provide more hints in netrw buffer warning (#148)

This commit is contained in:
Steven Arcangeli 2023-08-08 23:55:47 -07:00
parent b24380c0e1
commit a05b2eb54d

View file

@ -952,7 +952,11 @@ M.setup = function(opts)
end,
})
end
if vim.g.loaded_netrwPlugin ~= 1 and not config.silence_netrw_warning then
if
vim.g.loaded_netrwPlugin ~= 1
and not config.silence_netrw_warning
and config.default_file_explorer
then
vim.api.nvim_create_autocmd("FileType", {
desc = "Inform user how to disable netrw",
group = aug,
@ -960,7 +964,7 @@ M.setup = function(opts)
once = true,
callback = function()
vim.notify(
"If you expected an Oil buffer here, you may want to disable netrw (:help netrw-noload)\nSet `silence_netrw_warning = true` in oil.setup() to disable this message.",
"If you expected an Oil buffer here, you may want to disable netrw (:help netrw-noload)\nSet `default_file_explorer = false` in oil.setup() to not take over netrw buffers, or `silence_netrw_warning = true` to disable this message.",
vim.log.levels.WARN
)
end,