diff --git a/lua/catppuccin/core/palettes/init.lua b/lua/catppuccin/core/palettes/init.lua index ee4e36c..203e67c 100644 --- a/lua/catppuccin/core/palettes/init.lua +++ b/lua/catppuccin/core/palettes/init.lua @@ -1,6 +1,7 @@ local M = {} local cnf = require("catppuccin.config").options +local echo = require("catppuccin.utils.echo") function M.get_palette() local flvr = vim.g.catppuccin_flavour @@ -17,11 +18,7 @@ function M.get_palette() if palette[k] then palette[k] = v else - vim.api.nvim_echo( - { { 'Warning: "' .. k .. '" is not a valid catppucin palette color.', "WarningMsg" } }, - true, - {} - ) + echo('Warning: "' .. k .. '" is not a valid catppucin palette color') end end end diff --git a/lua/catppuccin/lib/ui.lua b/lua/catppuccin/lib/ui.lua index aa0ec6a..2af44fe 100644 --- a/lua/catppuccin/lib/ui.lua +++ b/lua/catppuccin/lib/ui.lua @@ -8,7 +8,6 @@ local latte = require("catppuccin.core.palettes.latte") function M.dim() if cnf.dim_inactive.shade == "dark" then - print(vim.g.catppuccin_flavour) return ucolors.vary_color( { latte = ucolors.darken(latte.base, dim_percentage, latte.mantle) }, ucolors.darken(cp.base, dim_percentage, cp.mantle) diff --git a/lua/catppuccin/utils/echo.lua b/lua/catppuccin/utils/echo.lua index adee6ed..5f69443 100644 --- a/lua/catppuccin/utils/echo.lua +++ b/lua/catppuccin/utils/echo.lua @@ -1,21 +1,25 @@ local TITLE = "Catppuccin" -return function(msg, level) +return function(msg, kind) local has_notify_plugin = pcall(require, "notify") + local level = {} - if level == "error" then - level = vim.log.levels.ERROR - elseif level == "warn" then - level = vim.log.levels.WARN + if kind == "error" then + level.log = vim.log.kinds.ERROR + level.type = "error" + elseif kind == "warn" then + level.log = vim.log.kinds.WARN + level.type = "error" else - level = level or vim.log.levels.INFO + level.log = kind or vim.log.kinds.INFO + level.type = "info" end if has_notify_plugin then - vim.notify(msg, level, { + vim.notify(msg, level.log, { title = TITLE, }) else - vim.notify(("[%s] %s"):format(TITLE, msg), level) + vim.notify(("%s (%s): %s"):format(TITLE, level.type,msg), level.log) end end