aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/notify.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-07-08 18:34:38 +0200
committerGitHub <noreply@github.com>2022-07-08 18:34:38 +0200
commit976aa4fbee8a070f362cab6f6ec84e9251a90cf9 (patch)
tree5e8d9c9c59444a25c7801b8f39763c4ba6e1f76d /lua/mason-core/notify.lua
parentfeat: add gotests, gomodifytags, impl (#28) (diff)
downloadmason-976aa4fbee8a070f362cab6f6ec84e9251a90cf9.tar
mason-976aa4fbee8a070f362cab6f6ec84e9251a90cf9.tar.gz
mason-976aa4fbee8a070f362cab6f6ec84e9251a90cf9.tar.bz2
mason-976aa4fbee8a070f362cab6f6ec84e9251a90cf9.tar.lz
mason-976aa4fbee8a070f362cab6f6ec84e9251a90cf9.tar.xz
mason-976aa4fbee8a070f362cab6f6ec84e9251a90cf9.tar.zst
mason-976aa4fbee8a070f362cab6f6ec84e9251a90cf9.zip
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
Diffstat (limited to 'lua/mason-core/notify.lua')
-rw-r--r--lua/mason-core/notify.lua13
1 files changed, 13 insertions, 0 deletions
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