mirror of
https://github.com/NotAShelf/direnv.nvim.git
synced 2026-04-16 15:24:15 +00:00
fix: respect configured notification level
This commit is contained in:
parent
9e58bb5e8d
commit
709f49358a
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