diff options
| author | ruki <[email protected]> | 2025-11-20 00:46:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-11-20 00:46:17 +0800 |
| commit | bb23918bcc9423cecc98275759d529adf41f4ca5 (patch) | |
| tree | 2665c846d3f89604fdfb24aa88ff94af0e74f803 /xmake/plugins/format/main.lua | |
| parent | d4f99444640e55c2170c7407ca567af2047dc558 (diff) | |
add
Diffstat (limited to 'xmake/plugins/format/main.lua')
| -rw-r--r-- | xmake/plugins/format/main.lua | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua index 743f67eb5..e8b962e2e 100644 --- a/xmake/plugins/format/main.lua +++ b/xmake/plugins/format/main.lua @@ -216,16 +216,25 @@ function main() jobs = os.default_njob() end local format_time = os.mclock() + local runjobs_opt = { + total = #sourcefiles, + comax = jobs, + showtips = false + } + -- Only set timer for multirow refresh mode + if progress.is_multirow() then + runjobs_opt.timeout = 500 + runjobs_opt.on_timer = function (running_indices) + -- Periodically refresh multirow progress to update elapsed time + progress.refresh() + end + end runjobs("clang-format", function (index, total, opt) local sourcefile = sourcefiles[index] local format_argv = table.join(argv, {sourcefile}) progress.show(opt.progress, "clang-format.formatting %s", sourcefile) os.execv(clang_format.program, format_argv, {curdir = projectdir}) - end, { - total = #sourcefiles, - comax = jobs, - showtips = false - }) + end, runjobs_opt) format_time = os.mclock() - format_time progress.show(100, "${color.success}clang-format formatted %d files, spent %.3fs", #sourcefiles, format_time / 1000) end |
