tools: Enable color for rakudo.
This commit is contained in:
parent
975737d71d
commit
812e6b4d83
3 changed files with 4 additions and 2 deletions
|
|
@ -164,8 +164,8 @@ class TermStr(collections.UserString):
|
||||||
parts = data.split(terminal.ESC)
|
parts = data.split(terminal.ESC)
|
||||||
fg_color, bg_color = None, None
|
fg_color, bg_color = None, None
|
||||||
is_bold, is_italic, is_underlined = False, False, False
|
is_bold, is_italic, is_underlined = False, False, False
|
||||||
result_parts = []
|
result_parts = [parts[0]]
|
||||||
for part in parts:
|
for part in parts[1:]:
|
||||||
try:
|
try:
|
||||||
end_index = part.index("m")
|
end_index = part.index("m")
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ tools_for_extensions = [
|
||||||
dependencies = ["rakudo"]
|
dependencies = ["rakudo"]
|
||||||
url = "https://rakudo.org/"
|
url = "https://rakudo.org/"
|
||||||
command = "perl6 -c"
|
command = "perl6 -c"
|
||||||
|
has_color = true
|
||||||
|
|
||||||
[git_blame]
|
[git_blame]
|
||||||
dependencies = ["git"]
|
dependencies = ["git"]
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ class TermStrTests(unittest.TestCase):
|
||||||
bg_color(termstr.Color.green))
|
bg_color(termstr.Color.green))
|
||||||
test_round_trip(termstr.TermStr("foo").fg_color(1))
|
test_round_trip(termstr.TermStr("foo").fg_color(1))
|
||||||
test_round_trip(termstr.TermStr("foo").bg_color(10))
|
test_round_trip(termstr.TermStr("foo").bg_color(10))
|
||||||
|
self.assertEqual(TermStr.from_term("foo"), termstr.TermStr("foo"))
|
||||||
self.assertEqual(TermStr.from_term(eris.terminal.ESC + "[33mfoo"),
|
self.assertEqual(TermStr.from_term(eris.terminal.ESC + "[33mfoo"),
|
||||||
termstr.TermStr("foo").fg_color(3))
|
termstr.TermStr("foo").fg_color(3))
|
||||||
self.assertEqual(TermStr.from_term(eris.terminal.ESC + "[45mfoo"),
|
self.assertEqual(TermStr.from_term(eris.terminal.ESC + "[45mfoo"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue