From 3864d3b9b912c283d49f0bb82479f766ca9a4521 Mon Sep 17 00:00:00 2001 From: LeMarsu Date: Thu, 30 May 2024 01:53:50 +0200 Subject: [PATCH] fix: prevent `setup` function to be called twice --- lua/sloth-flake/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/sloth-flake/init.lua b/lua/sloth-flake/init.lua index c427ee5..f22a5ee 100644 --- a/lua/sloth-flake/init.lua +++ b/lua/sloth-flake/init.lua @@ -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()