Closed GustavEikaas closed 1 month ago
Could probably extend the run_async with complementary spinner
local spinner_symbols = { '-', '\\', '|', '/' }
local spinner_index = 1
local spinner_timer = nil
local notify_id = nil
local function update_spinner()
if spinner_timer then
notify_id = vim.notify('Processing ' .. spinner_symbols[spinner_index], vim.log.levels.INFO, {
title = 'Progress',
replace = notify_id,
})
spinner_index = (spinner_index % #spinner_symbols) + 1
end
end
local function start_spinner()
spinner_timer = vim.loop.new_timer()
spinner_timer:start(0, 100, vim.schedule_wrap(update_spinner))
end
local function stop_spinner()
if spinner_timer then
spinner_timer:stop()
spinner_timer:close()
spinner_timer = nil
vim.notify('Job finished!', vim.log.levels.INFO, {
title = 'Progress',
replace = notify_id,
})
notify_id = nil
end
end
local function run_job_with_spinner(command)
start_spinner()
vim.fn.jobstart(command, {
on_exit = function()
vim.schedule(stop_spinner)
end,
})
end
Description
Will add the option to pass
--no-build
and--no-restore
using the propertiesnoBuild
andnoRestore
in the test_runner options sectionFeatures
Consider