Merge pull request #20 from alvarosevilla95/fix/notification-level-threshold
Some checks failed
Style & Lint / lint (5.1) (push) Has been cancelled
Style & Lint / style (0.19.1) (push) Has been cancelled

fix: respect configured notification level
This commit is contained in:
raf 2026-03-26 12:59:07 +03:00 committed by GitHub
commit a731762567
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)