This repository has been archived by the owner on Dec 19, 2022. It is now read-only.
-
Hi! I don't know where to ask, so I'm trying here... I have the following function in lua : function _BROWSERSYNC_TOGGLE()
if jobId then
print(jobId)
-- vim.cmd("call jobstop(jobId)")
else
jobId = vim.cmd("call jobstart(['browser-sync', 'start', '--server', '--files', '*', '--no-inject-changes'])")
end
end I'm trying to store the id of the job, because it says in Thanks for the guidance. |
Beta Was this translation helpful? Give feedback.
Answered by
zakissimo
Apr 4, 2022
Replies: 1 comment
-
Solved by doing the following: local jobId
function _BROWSERSYNC_TOGGLE()
if jobId then
vim.fn.jobstop(jobId)
jobId = nil
else
jobId = vim.fn.jobstart("browser-sync start --server --files * --no-inject-changes")
end
end |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
zakissimo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved by doing the following: