feat(iferr): add *-message* support

This commit is contained in:
Oleksandr Smirnov 2025-03-03 14:19:46 +02:00
parent bb31271311
commit a76ec8dfdc
No known key found for this signature in database
5 changed files with 43 additions and 1 deletions

View file

@ -15,7 +15,13 @@ function iferr.iferr()
local pos = vim.fn.getcurpos()[2]
local fpath = vim.fn.expand "%"
local rs = r.sync({ c.commands.iferr, "-pos", curb }, {
local cmd = { c.commands.iferr, "-pos", curb }
if c.iferr.message ~= nil and type(c.iferr.message) == "string" then
table.insert(cmd, "-message")
table.insert(cmd, c.iferr.message)
end
local rs = r.sync(cmd, {
stdin = u.readfile_joined(fpath),
})