+8
-2
lua/gopher/iferr.lua
+8
-2
lua/gopher/iferr.lua
···
14
15
local data = vim.fn.systemlist((c.commands.iferr .. " -pos " .. boff), vim.fn.bufnr "%")
16
if vim.v.shell_error ~= 0 then
17
+
if string.find(data[1], "no functions at") then
18
+
vim.print "no function found"
19
+
log.warn("iferr: no function at " .. boff)
20
+
return
21
+
end
22
+
23
+
log.error("failed. output: " .. vim.inspect(data))
24
+
error("iferr failed: " .. vim.inspect(data))
25
end
26
27
vim.fn.append(pos, data)