mirror of
https://github.com/NotAShelf/direnv.nvim.git
synced 2026-04-16 07:14:15 +00:00
Merge pull request #20 from alvarosevilla95/fix/notification-level-threshold
fix: respect configured notification level
This commit is contained in:
commit
a731762567
1 changed files with 10 additions and 3 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue