From d6255d98b9a09366d238e8579b18be9add773222 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 29 Oct 2025 23:58:15 +0800 Subject: add progress.show_output --- xmake/modules/utils/progress.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'xmake/modules/utils/progress.lua') diff --git a/xmake/modules/utils/progress.lua b/xmake/modules/utils/progress.lua index fadc443e1..ca6a9ec01 100644 --- a/xmake/modules/utils/progress.lua +++ b/xmake/modules/utils/progress.lua @@ -248,11 +248,6 @@ function _show_progress_with_singlerow_refresh(progress, format, ...) io.flush() end --- showing progress line without scroll? -function showing_without_scroll() - return _g.showing_without_scroll -end - -- show the message with progress function show(progress, format, ...) progress = type(progress) == "table" and progress:percent() or math.floor(progress) @@ -270,6 +265,15 @@ function show(progress, format, ...) end end +-- print additional output logs with colors outside the progress log area, such as warning logs. +-- it's used when the progress style is multirow/singlerow refresh. +function show_output(format, ...) + if _g.showing_without_scroll then + print("") + end + cprint(format, ...) +end + -- get the message text with progress function text(progress, format, ...) progress = type(progress) == "table" and progress:percent() or math.floor(progress) -- cgit v1.3.1