Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Jan 23, 2021
1 parent 449c1fb commit 165d9f2
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions rich/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,74 +900,6 @@ def split(

return lines

# def divide(self, offsets: Iterable[int]) -> Lines:
# """Divide text in to a number of lines at given offsets.

# Args:
# offsets (Iterable[int]): Offsets used to divide text.

# Returns:
# Lines: New RichText instances between offsets.
# """

# if not offsets:
# line = self.copy()
# return Lines([line])

# text = self.plain
# text_length = len(text)
# divide_offsets = [0, *offsets, text_length]
# line_ranges = list(zip(divide_offsets, divide_offsets[1:]))
# average_line_length = -(-text_length // len(line_ranges))
# _Span = Span

# new_lines = Lines(
# Text(
# text[start:end],
# style=self.style,
# justify=self.justify,
# overflow=self.overflow,
# )
# for start, end in line_ranges
# )
# line_ranges = [
# (offset, offset + len(line))
# for offset, line in zip(divide_offsets, new_lines)
# ]

# line_range_length = len(line_ranges)
# for span in self._spans:
# line_index = (span.start // average_line_length) % line_range_length

# line_start, line_end = line_ranges[line_index]
# if span.start < line_start:
# while True:
# line_index -= 1
# line_start, line_end = line_ranges[line_index]
# if span.start >= line_start:
# break
# elif span.start > line_end:
# while True:
# line_index += 1
# line_start, line_end = line_ranges[line_index]
# if span.start <= line_end:
# break

# while True:
# span, new_span = span.split(line_end)
# if span:
# start, end, style = span
# new_lines[line_index]._spans.append(
# _Span(start - line_start, end - line_start, style)
# )
# if new_span is None:
# break
# span = new_span
# line_index = (line_index + 1) % line_range_length
# line_start, line_end = line_ranges[line_index]

# return new_lines

def divide(self, offsets: Iterable[int]) -> Lines:
if not offsets:
return Lines([self.copy()])
Expand Down

0 comments on commit 165d9f2

Please sign in to comment.