summaryrefslogtreecommitdiff
path: root/xmake/core/base
diff options
context:
space:
mode:
authorruki <[email protected]>2019-01-03 23:13:50 +0800
committerruki <[email protected]>2019-01-03 13:23:05 +0800
commit7da17d16ef3bf08d1b683f95fcec1c6d48ecdee4 (patch)
tree7fd5f04ec77e3f33858545660531a89a49413ea8 /xmake/core/base
parente6bdff43415c485114ae9a68a435923497fb3059 (diff)
improve plain text in colors
Diffstat (limited to 'xmake/core/base')
-rw-r--r--xmake/core/base/colors.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/core/base/colors.lua b/xmake/core/base/colors.lua
index 570e001fc..589288f16 100644
--- a/xmake/core/base/colors.lua
+++ b/xmake/core/base/colors.lua
@@ -291,6 +291,14 @@ end
--
-- "${beer}hello${beer}world"
--
+-- theme:
+-- "${color.error}"
+-- "${bright color.warning}"
+--
+-- text:
+-- "${hello xmake}"
+-- "${hello xmake $beer}"
+--
function colors.translate(str)
-- check string
@@ -366,6 +374,9 @@ function colors.translate(str)
else
code = block:gsub("#", "38;5;")
end
+ elseif block:startswith("$") then
+ -- plain text, do not translate emoji
+ table.insert(text_buffer, block:sub(2))
else
-- get emoji code
local emoji_code = emoji.translate(block)