From 709f49358a6e14eac04f4677bc47c96aa88f3b8c Mon Sep 17 00:00:00 2001 From: Alvaro Date: Wed, 25 Mar 2026 23:58:55 +0100 Subject: [PATCH 1/2] fix: respect configured notification level --- lua/direnv.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lua/direnv.lua b/lua/direnv.lua index 12fc214..17f8d69 100644 --- a/lua/direnv.lua +++ b/lua/direnv.lua @@ -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) From 7130b03a154d0d8a15e5f594e7176e7e932118c7 Mon Sep 17 00:00:00 2001 From: Alvaro Date: Thu, 26 Mar 2026 10:17:39 +0100 Subject: [PATCH 2/2] stylua --- lua/direnv.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/direnv.lua b/lua/direnv.lua index 17f8d69..2cd57d5 100644 --- a/lua/direnv.lua +++ b/lua/direnv.lua @@ -82,8 +82,8 @@ end --- @param opts? table Additional notification options local function notify(msg, level, opts) local configured_level = M.config - and M.config.notifications - and M.config.notifications.level + and M.config.notifications + and M.config.notifications.level or vim.log.levels.INFO level = level or configured_level