summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/base/colors.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/core/base/colors.lua b/xmake/core/base/colors.lua
index bd4cf4089..69c91e7fd 100644
--- a/xmake/core/base/colors.lua
+++ b/xmake/core/base/colors.lua
@@ -334,6 +334,13 @@ function colors.translate(str, opt)
nocolors = true
end
+ -- is plain theme? no colors and no emoji
+ local noemoji = not colors.emoji()
+ if theme and theme:name() == "plain" then
+ nocolors = true
+ noemoji = true
+ end
+
-- get keys
local keys = colors.color256() and colors._keys256 or colors._keys8
if colors.truecolor() then
@@ -391,7 +398,7 @@ function colors.translate(str, opt)
elseif block:startswith("$") then
-- plain text, do not translate emoji
table.insert(text_buffer, block:sub(2))
- elseif colors.emoji() then
+ elseif not noemoji then
-- get emoji code
local emoji_code = emoji.translate(block)
if emoji_code then