From 709f49358a6e14eac04f4677bc47c96aa88f3b8c Mon Sep 17 00:00:00 2001 From: Alvaro Date: Wed, 25 Mar 2026 23:58:55 +0100 Subject: [PATCH] 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)