mirror of https://github.com/sgoudham/nvim.git
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.
22 lines
459 B
Lua
22 lines
459 B
Lua
2 years ago
|
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
|