feat: add ability to not hijack the unnamed buffer
This commit is contained in:
@@ -18,7 +18,11 @@ function M.init(with_open, foldername)
|
||||
TreeExplorer = explorer.Explorer.new(foldername)
|
||||
TreeExplorer:init(function()
|
||||
if with_open then
|
||||
view.open_in_current_win()
|
||||
if M.hijack_unnamed_buffer_when_opening then
|
||||
view.open_in_current_win()
|
||||
else
|
||||
view.open()
|
||||
end
|
||||
end
|
||||
renderer.draw()
|
||||
|
||||
@@ -143,4 +147,8 @@ M.reload_git = require'nvim-tree.actions.reloaders'.reload_git
|
||||
-- @deprecated: use nvim-tree.actions.find-file.fn
|
||||
M.set_index_and_redraw = require'nvim-tree.actions.find-file'.fn
|
||||
|
||||
function M.setup(opts)
|
||||
M.hijack_unnamed_buffer_when_opening = opts.hijack_unnamed_buffer_when_opening
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
Reference in New Issue
Block a user