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 _config = {}
|
||||||
|
|
||||||
local M = {}
|
local M = {
|
||||||
|
setup_called = false,
|
||||||
|
}
|
||||||
|
|
||||||
function M.focus()
|
function M.focus()
|
||||||
M.open()
|
M.open()
|
||||||
@@ -561,6 +563,12 @@ function M.setup(conf)
|
|||||||
return
|
return
|
||||||
end
|
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 {})
|
legacy.migrate_legacy_options(conf or {})
|
||||||
|
|
||||||
validate_options(conf)
|
validate_options(conf)
|
||||||
|
|||||||
Reference in New Issue
Block a user