fix: respect configured notification level

This commit is contained in:
Alvaro 2026-03-25 23:58:55 +01:00
commit 709f49358a

View file

@ -81,9 +81,16 @@ end
--- @param level? integer Log level
--- @param opts? table Additional notification options
local function notify(msg, level, opts)
-- Ensure level is an integer
level = level
or (M.config and M.config.notifications.level or vim.log.levels.INFO)
local configured_level = M.config
and M.config.notifications
and M.config.notifications.level
or vim.log.levels.INFO
level = level or configured_level
if level < configured_level then
return
end
opts = opts or {}
opts = vim.tbl_extend("force", { title = "direnv.nvim" }, opts)