summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-01-27 22:12:22 +0800
committerruki <[email protected]>2019-01-27 22:12:22 +0800
commit3be9a72ef4c9bcb5c57910321f19a50a74ab754a (patch)
tree87c5e1831190a79871ce47656982d7e3aa41d534
parent725afa219b013720a363f84badfc6696951c9840 (diff)
improve colors
-rw-r--r--xmake/core/base/colors.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/core/base/colors.lua b/xmake/core/base/colors.lua
index 4beddd073..6329e4360 100644
--- a/xmake/core/base/colors.lua
+++ b/xmake/core/base/colors.lua
@@ -316,8 +316,9 @@ function colors.translate(str)
str = str:gsub("(%${(.-)})", function(_, word)
-- not supported? ignore it
+ local nocolors = false
if not colors.color8() and not colors.color256() and not colors.truecolor() then
- return ""
+ nocolors = true
end
-- get keys
@@ -394,7 +395,7 @@ function colors.translate(str)
-- make result
local result = ""
- if #color_buffer > 0 then
+ if #color_buffer > 0 and not nocolors then
result = result .. colors._escape:format(table.concat(color_buffer, ";"))
end
if #text_buffer > 0 then