diff --git a/lua/catppuccino/core/mapper.lua b/lua/catppuccino/core/mapper.lua index d1e82e2..c9f77ff 100644 --- a/lua/catppuccino/core/mapper.lua +++ b/lua/catppuccino/core/mapper.lua @@ -190,8 +190,7 @@ function M.apply(cs) local good, color_scheme = require("catppuccino.core.cs").get_color_scheme(cs) if not good then - print(color_scheme) -- error message - return + return false, color_scheme -- error message end _G.cpt = color_scheme @@ -204,7 +203,7 @@ function M.apply(cs) _G.cpc = nil _G.cpt = nil - return theme + return true, theme end return M diff --git a/lua/catppuccino/main.lua b/lua/catppuccino/main.lua index e180f9d..0a77c99 100644 --- a/lua/catppuccino/main.lua +++ b/lua/catppuccino/main.lua @@ -9,7 +9,14 @@ local function load(args) catppuccino.before_loading() end - utils.load(require("catppuccino.core.mapper").apply(args)) + local good, theme = require("catppuccino.core.mapper").apply(args) + + if not good then + print(theme) -- error message + return + end + + utils.load(theme) if (catppuccino.after_loading ~= nil) then catppuccino.after_loading()