From 6c0bad9846160357b34395fee2bcebd4533935a4 Mon Sep 17 00:00:00 2001 From: Pocco81 Date: Fri, 20 Aug 2021 23:47:15 -0500 Subject: [PATCH] fix: structure --- lua/catppuccino/init.lua | 11 ----------- lua/catppuccino/main.lua | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lua/catppuccino/init.lua b/lua/catppuccino/init.lua index 828d9b9..443a956 100644 --- a/lua/catppuccino/init.lua +++ b/lua/catppuccino/init.lua @@ -1,18 +1,7 @@ local M = {} function M.load() - - local catppuccino = require("catppuccino") - - if (catppuccino.before_loading ~= nil) then - catppuccino.before_loading() - end - require("catppuccino.main").main("load") - - if (catppuccino.after_loading ~= nil) then - catppuccino.after_loading() - end end function M.setup(custom_opts, remaps) diff --git a/lua/catppuccino/main.lua b/lua/catppuccino/main.lua index 3e20b0c..e180f9d 100644 --- a/lua/catppuccino/main.lua +++ b/lua/catppuccino/main.lua @@ -2,13 +2,27 @@ local M = {} local utils = require("catppuccino.utils.util") +local function load(args) + local catppuccino = require("catppuccino") + + if (catppuccino.before_loading ~= nil) then + catppuccino.before_loading() + end + + utils.load(require("catppuccino.core.mapper").apply(args)) + + if (catppuccino.after_loading ~= nil) then + catppuccino.after_loading() + end +end + function M.main(option, args) option = option or "load" if (option == "load") then - utils.load(require("catppuccino.core.mapper").apply(args)) + load(args) else - print("Catppuccino: Command was not recognized") + print("Catppuccino: command was not recognized") end end