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)
|
||||
fg_color, bg_color = None, None
|
||||
is_bold, is_italic, is_underlined = False, False, False
|
||||
result_parts = []
|
||||
for part in parts:
|
||||
result_parts = [parts[0]]
|
||||
for part in parts[1:]:
|
||||
try:
|
||||
end_index = part.index("m")
|
||||
except ValueError:
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ tools_for_extensions = [
|
|||
dependencies = ["rakudo"]
|
||||
url = "https://rakudo.org/"
|
||||
command = "perl6 -c"
|
||||
has_color = true
|
||||
|
||||
[git_blame]
|
||||
dependencies = ["git"]
|
||||
|
|
|
|||
|
|
@ -136,6 +136,7 @@ class TermStrTests(unittest.TestCase):
|
|||
bg_color(termstr.Color.green))
|
||||
test_round_trip(termstr.TermStr("foo").fg_color(1))
|
||||
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"),
|
||||
termstr.TermStr("foo").fg_color(3))
|
||||
self.assertEqual(TermStr.from_term(eris.terminal.ESC + "[45mfoo"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue