From 976aa4fbee8a070f362cab6f6ec84e9251a90cf9 Mon Sep 17 00:00:00 2001 From: William Boman Date: Fri, 8 Jul 2022 18:34:38 +0200 Subject: refactor: add mason-schemas and mason-core modules (#29) * refactor: add mason-schemas and move generated filetype map to mason-lspconfig * refactor: add mason-core module --- lua/mason-core/notify.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lua/mason-core/notify.lua (limited to 'lua/mason-core/notify.lua') diff --git a/lua/mason-core/notify.lua b/lua/mason-core/notify.lua new file mode 100644 index 00000000..b41c7e64 --- /dev/null +++ b/lua/mason-core/notify.lua @@ -0,0 +1,13 @@ +local TITLE = "mason.nvim" + +return function(msg, level) + local has_notify_plugin = pcall(require, "notify") + level = level or vim.log.levels.INFO + if has_notify_plugin then + vim.notify(msg, level, { + title = TITLE, + }) + else + vim.notify(("[%s] %s"):format(TITLE, msg), level) + end +end -- cgit v1.2.3-70-g09d2