summaryrefslogtreecommitdiff
path: root/xmake/core/base
diff options
context:
space:
mode:
authorruki <[email protected]>2019-01-03 22:35:18 +0800
committerruki <[email protected]>2019-01-03 09:31:51 +0800
commit22a3a1c21f41205fa5ea71a4fd0a0d9caa2b8963 (patch)
treedd5690fcf3b4168f0ba36e0c00aa84b82d728c1f /xmake/core/base
parentec40e9e8f26530aef3fc785a8c138b4710046475 (diff)
add build.progress_format style
Diffstat (limited to 'xmake/core/base')
-rw-r--r--xmake/core/base/colors.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/xmake/core/base/colors.lua b/xmake/core/base/colors.lua
index b0e87bcdc..cefd10774 100644
--- a/xmake/core/base/colors.lua
+++ b/xmake/core/base/colors.lua
@@ -304,8 +304,8 @@ function colors.translate(str)
-- patch reset
str = "${reset}" .. str .. "${reset}"
- -- translate it
- str = string.gsub(str, "(%${(.-)})", function(_, word)
+ -- translate color blocks, e.g. ${red}, ${color.xxx}, ${emoji}
+ str = str:gsub("(%${(.-)})", function(_, word)
-- not supported? ignore it
if not colors.color8() and not colors.color256() and not colors.truecolor() then
@@ -316,7 +316,11 @@ function colors.translate(str)
if theme then
local theme_word = theme:get(word)
if theme_word then
- word = theme_word
+ if word:startswith("text.") then
+ return theme_word
+ else
+ word = theme_word
+ end
end
if word == "" then
return ""