Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Grabbing jobstart id in lua #103

Answered by zakissimo
zakissimo asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zakissimo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant