Fix notify.nvim receiving string log levels
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user