ci/woodpecker/pr/ci Pipeline was successful
ui/window.lua has the two-pane frame and tracks the open comment window, so the frame no longer needs an on_close hook. ui/notify.lua replaces notify(message, kind) with info, warn and error.
28 lines
590 B
Lua
28 lines
590 B
Lua
local M = {}
|
|
|
|
---@param message string
|
|
---@param level integer
|
|
---@param opts table
|
|
local function send(message, level, opts)
|
|
vim.schedule(function()
|
|
vim.notify(message, level, vim.tbl_extend("keep", opts, { title = "scratch-comments" }))
|
|
end)
|
|
end
|
|
|
|
---@param message string
|
|
function M.info(message)
|
|
send(message, vim.log.levels.INFO, {})
|
|
end
|
|
|
|
---@param message string
|
|
function M.warn(message)
|
|
send(message, vim.log.levels.WARN, { timeout = 10000 })
|
|
end
|
|
|
|
---@param message string
|
|
function M.error(message)
|
|
send(message, vim.log.levels.ERROR, { timeout = 10000 })
|
|
end
|
|
|
|
return M
|