@ -15,13 +15,13 @@ function M.get_color_scheme(cs)
local good, color_scheme = pcall(require, "catppuccino.color_schemes." .. cs)
if not good then
return false, "Catppuccino: the colorscheme '" .. cs .. "' was not recognized."
return {status = false, msg = "Catppuccino: the colorscheme '" .. cs .. "' was not recognized. Defaulting to Catppuccino Dark."}, require("catppuccino.color_schemes.catppuccino")
end
if not (next(remaps) == nil) then
return true, vim.tbl_deep_extend("force", color_scheme, remaps)
return {status = true}, vim.tbl_deep_extend("force", color_scheme, remaps)
else
return true, color_scheme
return {status = true}, color_scheme
@ -202,10 +202,10 @@ end
function M.apply(cs)
_G.cpc = require("catppuccino.config").options
cs = cs or cpc.colorscheme
local good, color_scheme = require("catppuccino.core.cs").get_color_scheme(cs)
local err, color_scheme = require("catppuccino.core.cs").get_color_scheme(cs)
if not err.status then
return false, color_scheme -- error message
vim.api.nvim_err_writeln(err.msg)
set_cs(color_scheme)
@ -217,7 +217,7 @@ function M.apply(cs)
-- uninstantiate to avoid poluting global scope and because they are not needed anymore
_G.cpc = nil
return true, theme
return theme
return M
@ -9,13 +9,7 @@ local function load(args)
catppuccino.before_loading()
local good, theme = require("catppuccino.core.mapper").apply(args)
local theme = require("catppuccino.core.mapper").apply(args)
print(theme) -- error message
return
utils.load(theme)
if (catppuccino.after_loading ~= nil) then
@ -1,8 +1,7 @@
local good, color_scheme = require("catppuccino.core.cs").get_color_scheme(require("catppuccino.config").options["colorscheme"])
local err, color_scheme = require("catppuccino.core.cs").get_color_scheme(require("catppuccino.config").options["colorscheme"])
print(color_scheme) -- error message
local cpt = color_scheme