From 70df77cf3fea39913a0a0d87f66ef46e4fb341a1 Mon Sep 17 00:00:00 2001 From: DarthMooMancer <107283522+DarthMooMancer@users.noreply.github.com> Date: Fri, 11 Apr 2025 19:36:08 -0400 Subject: [PATCH] Trying to make the settings actually enable and work --- lua/Polydev/init.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/Polydev/init.lua b/lua/Polydev/init.lua index 88a6c86..ee1f5ef 100644 --- a/lua/Polydev/init.lua +++ b/lua/Polydev/init.lua @@ -14,10 +14,12 @@ function M.load_language_module(lang) local ok, lang_module = pcall(require, "Polydev." .. lang) if ok and lang_module.setup then - lang_module.setup() + local opts = M.language_opts and M.language_opts[lang] or {} + lang_module.setup(opts) M.loaded_languages[lang] = lang_module return true end + return false end @@ -45,7 +47,13 @@ function M.create_new_file() end) end -function M.setup() +function M.setup(opts) + opts = opts or {} + + -- Send config to globals + require("Polydev.globals").setup(opts.globals or {}) + M.language_opts = opts -- store all opts, including language-specific one + vim.api.nvim_create_user_command("NewProject", M.create_project, {}) vim.api.nvim_create_user_command("NewFile", M.create_new_file, {}) vim.keymap.set("n", "np", ":NewProject", { silent = true })