Give users the option to enable netrw
This commit is contained in:
@@ -124,11 +124,14 @@ function M.on_enter()
|
||||
|
||||
local stats = luv.fs_stat(bufname)
|
||||
local is_dir = stats and stats.type == 'directory'
|
||||
|
||||
local disable_netrw = vim.g.nvim_tree_disable_netrw or 1
|
||||
local hijack_netrw = vim.g.nvim_tree_hijack_netrw or 1
|
||||
if is_dir then
|
||||
api.nvim_command('cd '..bufname)
|
||||
end
|
||||
local should_open = vim.g.nvim_tree_auto_open == 1 and
|
||||
(bufname == '' or is_dir) and
|
||||
((is_dir and (hijack_netrw == 1 or disable_netrw == 1)) or bufname == '') and
|
||||
not vim.tbl_contains(ft_ignore, buftype)
|
||||
colors.setup()
|
||||
lib.init(should_open, should_open)
|
||||
|
||||
Reference in New Issue
Block a user