Files
auto-save.nvim/lua/auto-save/utils/echo.lua
Oula Kuuva 343bbfa98a style: autoformat all the things
Namely: applied stylua to the whole repo and ran marksman on README.md.
2023-03-21 08:57:03 +02:00

26 lines
550 B
Lua

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"):format(TITLE, msg), level.log)
end
end