Files
eleith 966409c759
ci/woodpecker/pr/ci Pipeline was successful
Move the comment window and notifications into ui/
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.
2026-09-22 09:25:32 -07:00

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