From a05b2eb54d3e795de6e94c2c1dc242a063768921 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Tue, 8 Aug 2023 23:55:47 -0700 Subject: [PATCH] doc: provide more hints in netrw buffer warning (#148) --- lua/oil/init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/oil/init.lua b/lua/oil/init.lua index bac18a3..0be3d27 100644 --- a/lua/oil/init.lua +++ b/lua/oil/init.lua @@ -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,