mirror of
https://github.com/NotAShelf/direnv.nvim.git
synced 2026-04-17 07:40:05 +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 level? integer Log level
|
||||||
--- @param opts? table Additional notification options
|
--- @param opts? table Additional notification options
|
||||||
local function notify(msg, level, opts)
|
local function notify(msg, level, opts)
|
||||||
-- Ensure level is an integer
|
local configured_level = M.config
|
||||||
level = level
|
and M.config.notifications
|
||||||
or (M.config and M.config.notifications.level or vim.log.levels.INFO)
|
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 = opts or {}
|
||||||
opts = vim.tbl_extend("force", { title = "direnv.nvim" }, opts)
|
opts = vim.tbl_extend("force", { title = "direnv.nvim" }, opts)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue