refactor(utils): notify now has title
This commit is contained in:
parent
e49ee67ecc
commit
e2ef9dbcd7
1 changed files with 15 additions and 2 deletions
|
|
@ -1,5 +1,7 @@
|
|||
local utils = {}
|
||||
|
||||
local TITLE = "gopher.nvim"
|
||||
|
||||
---@param t table
|
||||
---@return boolean
|
||||
function utils.is_tbl_empty(t)
|
||||
|
|
@ -10,13 +12,24 @@ function utils.is_tbl_empty(t)
|
|||
end
|
||||
|
||||
---@param msg string
|
||||
---@param lvl any
|
||||
---@param lvl number
|
||||
function utils.deferred_notify(msg, lvl)
|
||||
vim.defer_fn(function()
|
||||
vim.notify(msg, lvl)
|
||||
vim.notify(msg, lvl, {
|
||||
title = TITLE,
|
||||
})
|
||||
end, 0)
|
||||
end
|
||||
|
||||
---@param msg string
|
||||
---@param lvl? number
|
||||
function utils.notify(msg, lvl)
|
||||
lvl = lvl or vim.log.levels.INFO
|
||||
vim.notify(msg, lvl, {
|
||||
title = TITLE,
|
||||
})
|
||||
end
|
||||
|
||||
-- safe require
|
||||
---@param module string module name
|
||||
function utils.sreq(module)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue