From 05ec65d169d7720a9e74396d738bcc6510fa78ca Mon Sep 17 00:00:00 2001 From: Will Ruggiano Date: Wed, 5 Jul 2023 23:04:15 -0600 Subject: [PATCH] fix: notify-send for vim.notify is boring --- plugins/bombadil.lua | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/plugins/bombadil.lua b/plugins/bombadil.lua index 07cc3a5..aedcc3d 100644 --- a/plugins/bombadil.lua +++ b/plugins/bombadil.lua @@ -1,27 +1,3 @@ return function() vim.cmd.colorscheme "flavours" - - local vim_to_sys = { - [vim.log.levels.TRACE] = "low", - [vim.log.levels.DEBUG] = "low", - [vim.log.levels.INFO] = "normal", - [vim.log.levels.WARN] = "normal", - [vim.log.levels.ERROR] = "critical", - } - - local notify = vim.notify - local function notify_send(msg, level, opts) - if not pcall(os.execute, string.format("notify-send -u %s Neovim '%s'", vim_to_sys[level], msg)) then - notify(msg, level, opts) - end - end - - local notifiers = { - [vim.log.levels.WARN] = notify_send, - [vim.log.levels.ERROR] = notify_send, - } - ---@diagnostic disable-next-line: duplicate-set-field - vim.notify = function(msg, level, opts) - (notifiers[level] or notify)(msg, level, opts) - end end