feat: guard against multiple setup calls (#1308)
This commit is contained in:
committed by
GitHub
parent
8198fa01fc
commit
b1ecb75a6c
@@ -16,7 +16,9 @@ local collapse_all = require "nvim-tree.actions.collapse-all"
|
||||
|
||||
local _config = {}
|
||||
|
||||
local M = {}
|
||||
local M = {
|
||||
setup_called = false,
|
||||
}
|
||||
|
||||
function M.focus()
|
||||
M.open()
|
||||
@@ -561,6 +563,12 @@ function M.setup(conf)
|
||||
return
|
||||
end
|
||||
|
||||
if M.setup_called then
|
||||
utils.warn "nvim-tree.lua setup called multiple times"
|
||||
return
|
||||
end
|
||||
M.setup_called = true
|
||||
|
||||
legacy.migrate_legacy_options(conf or {})
|
||||
|
||||
validate_options(conf)
|
||||
|
||||
Reference in New Issue
Block a user