Skip to content

Commit 0e5dc44

Browse files
Commit
1 parent 42738b3 commit 0e5dc44

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Lib/idlelib/colorizer.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,20 +575,18 @@ def _add_tag(self, start, end, head, matched_group_name):
575575
f"{head}+{end:d}c")
576576

577577
def _add_tags_in_section(self, chars, head):
578-
"""Parse and add highlighting tags using pyrepl's tokenization.
578+
"""Parse and add highlighting tags to a given part of the text..
579579
580580
`chars` is a string with the text to parse and to which
581581
highlighting is to be applied.
582582
583583
`head` is the index in the text widget where the text is found.
584584
"""
585-
# Use pyrepl's gen_colors to get color spans
586585
color_spans = list(gen_colors(chars))
587586

588-
# Convert pyrepl spans to IDLE text widget positions and add tags
589587
for color_span in color_spans:
590588
start_pos = color_span.span.start
591-
end_pos = color_span.span.end + 1 # pyrepl spans are inclusive, tkinter expects exclusive end
589+
end_pos = color_span.span.end + 1
592590
tag = color_span.tag
593591
self._add_tag(start_pos, end_pos, head, tag)
594592

0 commit comments

Comments
 (0)