added echo utility

dev
Pocco81 2 years ago
parent 8b707ee660
commit f9a412002f

@ -0,0 +1,21 @@
local TITLE = "Catppuccin"
return function(msg, level)
local has_notify_plugin = pcall(require, "notify")
if level == "error" then
level = vim.log.levels.ERROR
elseif level == "warn" then
level = vim.log.levels.WARN
else
level = level or vim.log.levels.INFO
end
if has_notify_plugin then
vim.notify(msg, level, {
title = TITLE,
})
else
vim.notify(("[%s] %s"):format(TITLE, msg), level)
end
end
Loading…
Cancel
Save