summaryrefslogtreecommitdiff
path: root/xmake/modules/private/utils/progress.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/private/utils/progress.lua')
-rw-r--r--xmake/modules/private/utils/progress.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/modules/private/utils/progress.lua b/xmake/modules/private/utils/progress.lua
index f95baa088..45f148d5f 100644
--- a/xmake/modules/private/utils/progress.lua
+++ b/xmake/modules/private/utils/progress.lua
@@ -20,6 +20,7 @@
-- imports
import('core.base.object')
+import('core.theme.theme')
-- print back characters
function _make_clearchars(backnum)
@@ -75,17 +76,16 @@ end
-- @params stream - stream to write to, will use io.stdout if not provided
-- @params opt - options
-- - chars - an array of chars for progress indicator
--- - width - width of progress indicator, will use #opt.chars[0] if not provided
+-- - width - width of progress indicator, will use #opt.chars[1] if not provided
function new(stream, opt)
-- set default values
stream = stream or io.stdout
opt = opt or {}
if opt.chars == nil or #opt.chars == 0 then
- opt.chars = {'⢎⠀', '⢆⡀', '⢄⡠', '⢀⡰','⠀⡱', '⠈⠱', '⠊⠑', '⠎⠁'}
- opt.width = 2
+ opt.chars = theme.get("text.spinner.chars")
end
opt.width = opt.width or #opt.chars[1]
return process { _OPT = opt, _STREAM = stream, _RUNNING = 0, _INDEX = 0, _CLEAR = _make_clearchars(opt.width) }
-end \ No newline at end of file
+end