Skip to content

Commit

Permalink
fix: do not use the deprecated API vim.tbl_add_reverse_lookup (#270)
Browse files Browse the repository at this point in the history
vim.tbl_add_reverse_lookup has been deprecated since NVIM 0.10.
Deprecations warnings will be raised since 0.11-dev.
  • Loading branch information
wookayin authored May 17, 2024
1 parent 5371f4b commit d333b6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/notify/service/notification.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
local Notification = {}

local level_maps = vim.tbl_extend("keep", {}, vim.log.levels)
vim.tbl_add_reverse_lookup(level_maps)
for k, v in pairs(vim.log.levels) do
level_maps[v] = k
end

function Notification:new(id, message, level, opts, config)
if type(level) == "number" then
Expand Down

0 comments on commit d333b6f

Please sign in to comment.