Skip to content

Commit b005821

Browse files
author
Rónán Carrigan
committed
fix(notification): reverse lookup level
See #161
1 parent e51722e commit b005821

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/notify/service/notification.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@
1515
---@field render fun(buf: integer, notification: Notification, highlights: table<string, string>)
1616
local Notification = {}
1717

18+
local level_maps = vim.tbl_extend("keep", {}, vim.log.levels)
19+
vim.tbl_add_reverse_lookup(level_maps)
20+
1821
function Notification:new(id, message, level, opts, config)
1922
if type(level) == "number" then
20-
level = vim.log.levels[level]
23+
level = level_maps[level]
2124
end
2225
if type(message) == "string" then
2326
message = vim.split(message, "\n")

0 commit comments

Comments
 (0)