Skip to content

Commit fde9cf3

Browse files
committed
feat: add stop function for stopping running project
1 parent af2b9b5 commit fde9cf3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lua/love2d/init.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,14 @@ love2d.run = function(path)
2424
})
2525
end
2626

27+
---Stop the running project
28+
love2d.stop = function()
29+
if not love2d.job.id then
30+
vim.notify("No LÖVE project running.", vim.log.levels.ERROR)
31+
return
32+
end
33+
vim.notify("Stop LÖVE project")
34+
vim.fn.jobstop(love2d.job.id)
35+
end
36+
2737
return love2d

0 commit comments

Comments
 (0)