You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nvim/lua/catppuccin/utils/echo.lua

26 lines
538 B
Lua

local TITLE = "Catppuccin"
return function(msg, kind)
local has_notify_plugin = pcall(require, "notify")
local level = {}
if kind == "error" then
level.log = vim.log.levels.ERROR
level.type = "error"
elseif kind == "warn" then
level.log = vim.log.levels.WARN
level.type = "error"
else
level.log = kind or vim.log.levels.INFO
level.type = "info"
end
if has_notify_plugin then
vim.notify(msg, level.log, {
title = TITLE,
})
else
vim.notify(("%s (%s): %s"):format(TITLE, level.type, msg), level.log)
end
end