Skip to content

Commit 165d9f2

Browse files
committed
remove comments
1 parent 449c1fb commit 165d9f2

File tree

1 file changed

+0
-68
lines changed

1 file changed

+0
-68
lines changed

rich/text.py

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -900,74 +900,6 @@ def split(
900900

901901
return lines
902902

903-
# def divide(self, offsets: Iterable[int]) -> Lines:
904-
# """Divide text in to a number of lines at given offsets.
905-
906-
# Args:
907-
# offsets (Iterable[int]): Offsets used to divide text.
908-
909-
# Returns:
910-
# Lines: New RichText instances between offsets.
911-
# """
912-
913-
# if not offsets:
914-
# line = self.copy()
915-
# return Lines([line])
916-
917-
# text = self.plain
918-
# text_length = len(text)
919-
# divide_offsets = [0, *offsets, text_length]
920-
# line_ranges = list(zip(divide_offsets, divide_offsets[1:]))
921-
# average_line_length = -(-text_length // len(line_ranges))
922-
# _Span = Span
923-
924-
# new_lines = Lines(
925-
# Text(
926-
# text[start:end],
927-
# style=self.style,
928-
# justify=self.justify,
929-
# overflow=self.overflow,
930-
# )
931-
# for start, end in line_ranges
932-
# )
933-
# line_ranges = [
934-
# (offset, offset + len(line))
935-
# for offset, line in zip(divide_offsets, new_lines)
936-
# ]
937-
938-
# line_range_length = len(line_ranges)
939-
# for span in self._spans:
940-
# line_index = (span.start // average_line_length) % line_range_length
941-
942-
# line_start, line_end = line_ranges[line_index]
943-
# if span.start < line_start:
944-
# while True:
945-
# line_index -= 1
946-
# line_start, line_end = line_ranges[line_index]
947-
# if span.start >= line_start:
948-
# break
949-
# elif span.start > line_end:
950-
# while True:
951-
# line_index += 1
952-
# line_start, line_end = line_ranges[line_index]
953-
# if span.start <= line_end:
954-
# break
955-
956-
# while True:
957-
# span, new_span = span.split(line_end)
958-
# if span:
959-
# start, end, style = span
960-
# new_lines[line_index]._spans.append(
961-
# _Span(start - line_start, end - line_start, style)
962-
# )
963-
# if new_span is None:
964-
# break
965-
# span = new_span
966-
# line_index = (line_index + 1) % line_range_length
967-
# line_start, line_end = line_ranges[line_index]
968-
969-
# return new_lines
970-
971903
def divide(self, offsets: Iterable[int]) -> Lines:
972904
if not offsets:
973905
return Lines([self.copy()])

0 commit comments

Comments
 (0)