Fix notify.nvim receiving string log levels

This commit is contained in:
2026-04-15 17:57:38 +00:00
parent f436e2e890
commit 9b9716f372
+17 -1
View File
@@ -27,7 +27,7 @@ require("mini.notify").setup {
}
}
vim.notify =
local notify =
MiniNotify.make_notify(
{
DEBUG = {duration = 0},
@@ -39,6 +39,22 @@ vim.notify =
}
)
vim.notify = function(msg, level, opts)
if type(msg) ~= "string" then
msg = vim.inspect(msg)
end
if type(level) == "string" then
level = vim.log.levels[level:upper()] or vim.log.levels.INFO
end
if type(level) ~= "number" then
level = vim.log.levels.INFO
end
return notify(msg, level, opts)
end
vim.cmd("hi! link MiniNotifyBorder NotifyINFOBorder")
vim.cmd("hi! link MiniNotifyNormal NotifyINFOBody")
vim.cmd("hi! link MiniNotifyTitle Number")