fix: update deprecated vim api usage (#155)
replace `termopen` (deprecated according to [the docs](https://neovim.io/doc/user/deprecated.html#deprecated-0.11)) with `jobstart`
This commit is contained in:
committed by
GitHub
parent
4839ab6429
commit
0cb05f46bf
@@ -46,7 +46,13 @@ local function exec_lazygit_command(cmd)
|
|||||||
if LAZYGIT_LOADED == false then
|
if LAZYGIT_LOADED == false then
|
||||||
-- ensure that the buffer is closed on exit
|
-- ensure that the buffer is closed on exit
|
||||||
vim.g.lazygit_opened = 1
|
vim.g.lazygit_opened = 1
|
||||||
vim.fn.termopen(cmd, { on_exit = on_exit })
|
|
||||||
|
local command = {}
|
||||||
|
for arg in string.gmatch(cmd, "%S+") do
|
||||||
|
table.insert(command, arg)
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.fn.jobstart(command, { term = true, on_exit = on_exit} )
|
||||||
end
|
end
|
||||||
vim.cmd("startinsert")
|
vim.cmd("startinsert")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user