Skip to content

Commit

Permalink
fix(_utils): set notification level
Browse files Browse the repository at this point in the history
  • Loading branch information
olexsmir committed Jun 27, 2022
1 parent 2adbb49 commit ebb3894
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lua/gopher/_utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,19 @@ return {
end,

---@param msg string
---@param lvl string
---@param lvl string|integer
notify = function(msg, lvl)
local l
if lvl == "error" or lvl == 4 then
l = vim.log.levels.ERROR
elseif lvl == "info" or lvl == 2 then
l = vim.log.levels.INFO
elseif lvl == "debug" or lvl == 1 then
l = vim.log.levels.DEBUG
end

vim.defer_fn(function()
vim.notify(msg, lvl)
vim.notify(msg, l)
end, 0)
end,
}

0 comments on commit ebb3894

Please sign in to comment.