fix: prevent `setup` function to be called twice

main
LeMarsu 2024-05-30 01:53:50 +02:00
parent 805b41ed58
commit 3864d3b9b9
1 changed files with 6 additions and 0 deletions

View File

@ -1,5 +1,6 @@
local deps = require 'sloth-flake.deps'
local priv = {
setup_called = false,
is = {
init = {},
import = {},
@ -182,6 +183,11 @@ function unshim_plugin(name)
end
function M.setup(config)
if priv.setup_called then
return
end
priv.setup_called = true
local post_init = config and config.post_init or function() end
M.init_non_lazy()