Skip to content

Commit 78b641d

Browse files
pablogsalCopilot
andauthored
Update content.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 3ed6987 commit 78b641d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Lib/_pyrepl/content.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,24 @@ def build_body_fragments(
5959
colors: list[ColorSpan] | None,
6060
start_index: int,
6161
) -> tuple[ContentFragment, ...]:
62+
if colors is None:
63+
return tuple(
64+
ContentFragment(
65+
styled_char.text,
66+
styled_char.width,
67+
StyleRef(),
68+
)
69+
for styled_char in iter_display_chars(buffer, colors, start_index)
70+
)
71+
6272
theme = THEME()
6373
return tuple(
6474
ContentFragment(
6575
styled_char.text,
6676
styled_char.width,
6777
StyleRef.from_tag(styled_char.tag, theme[styled_char.tag])
68-
if styled_char.tag else
69-
StyleRef(),
78+
if styled_char.tag
79+
else StyleRef(),
7080
)
7181
for styled_char in iter_display_chars(buffer, colors, start_index)
7282
)

0 commit comments

Comments
 (0)