BREAKING CHANGES: plugin rewrite

This commit is contained in:
Pocco81
2022-07-31 00:27:43 -05:00
parent 8df684bcb3
commit 0288839edd
18 changed files with 430 additions and 807 deletions
+25
View File
@@ -0,0 +1,25 @@
local TITLE = "auto-save"
return function(msg, kind)
local has_notify_plugin = pcall(require, "notify")
local level = {}
if kind == "error" then
level.log = vim.log.levels.ERROR
level.type = "error"
elseif kind == "warn" then
level.log = vim.log.levels.WARN
level.type = "error"
else
level.log = kind or vim.log.levels.INFO
level.type = "info"
end
if has_notify_plugin then
vim.notify(msg, level.log, {
title = TITLE,
})
else
vim.notify(("%s (%s): %s"):format(TITLE, level.type, msg), level.log)
end
end