From d1aa9a979cbfe8b581f63295d30d49b77cad5b84 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Mon, 5 Aug 2024 22:12:19 +0300 Subject: refactor(nvim)!: Notify function signature and Notify usages --- .config/nvim/lua/custom/globals.lua | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to '.config/nvim/lua/custom/globals.lua') diff --git a/.config/nvim/lua/custom/globals.lua b/.config/nvim/lua/custom/globals.lua index ccadddd..106009a 100644 --- a/.config/nvim/lua/custom/globals.lua +++ b/.config/nvim/lua/custom/globals.lua @@ -1,16 +1,23 @@ -function Notify(title, message, level) +function Notify(message, title, level) + if not title then + if not level then + title = 'info' + else + title = level + end + end local notify = require('notify') - notify(message, level, { title = title }) + notify(message, level, { title = ' ' .. title }) end function ToggleWrap() if vim.wo.wrap then vim.wo.wrap = false - Notify('Wrap disabled', 'info') + Notify('Wrap disabled') else vim.wo.wrap = true vim.wo.number = false - Notify('Wrap enabled', 'info') + Notify('Wrap enabled') end end @@ -18,8 +25,8 @@ function ToggleInlayHints() local is_enabled = vim.lsp.inlay_hint.is_enabled({}) vim.lsp.inlay_hint.enable(not is_enabled) if is_enabled then - Notify('Inlay Hints disabled', 'info') + Notify('Inlay Hints disabled') else - Notify('Inlay Hints enabled', 'info') + Notify('Inlay Hints enabled') end end -- cgit v1.3.1