fix(iferr): now this not have type errors
This commit is contained in:
parent
674320821f
commit
d91bae8864
1 changed files with 4 additions and 5 deletions
|
|
@ -1,16 +1,15 @@
|
|||
local c = require("gopher.config").config.commands
|
||||
|
||||
---Add iferr declaration
|
||||
---That's Lua of vimscript implementation of:
|
||||
---github.com/koron/iferr
|
||||
return function()
|
||||
local c = require("gopher.config").config.commands
|
||||
local u = require "gopher._utils"
|
||||
|
||||
local boff = vim.fn.wordcount().cursor_bytes
|
||||
local cmd = (c.iferr .. " -pos " .. boff)
|
||||
local data = vim.fn.systemlist(cmd, vim.fn.bufnr "%")
|
||||
local data = vim.fn.systemlist(cmd, vim.fn.bufnr(0)) --[[@as string]]
|
||||
|
||||
if vim.v.shell_error ~= 0 then
|
||||
u.notify("command " .. cmd .. " exited with code " .. vim.v.shell_error, "error")
|
||||
error("iferr exited with code: " .. vim.v.shell_error)
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue