Skip to content

Commit

Permalink
fix(utils): Vim:E475 after adding opts to jobstart wrapper
Browse files Browse the repository at this point in the history
Looks like I've broken open and save after adding opts. This should
adress this. For some reason vim.fn.jobstart() can't handle an empty
table as opts. Maybe someone has a better solution that this, but this
works for now.
  • Loading branch information
MarcoBuess committed Jun 11, 2024
1 parent d7af548 commit 1ca57ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/markmap/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ local is_windows = vim.uv.os_uname().sysname == "Windows_NT"
---@return number job pid of the job, so we can stop it later.
M.jobstart = function(cmd, arguments, opts)
if is_windows then
return vim.fn.jobstart({ cmd, unpack(arguments) }, opts)
return opts and vim.fn.jobstart({ cmd, unpack(arguments) }, opts) or vim.fn.jobstart({ cmd, unpack(arguments) })
else
return vim.fn.jobstart(cmd .. " " .. table.concat(arguments, " "), opts)
return opts and vim.fn.jobstart(cmd .. " " .. table.concat(arguments, " "), opts) or vim.fn.jobstart(cmd .. " " .. table.concat(arguments, " "))
end
end

Expand Down

0 comments on commit 1ca57ed

Please sign in to comment.