Skip to content

Commit

Permalink
Document the behavior of find_break()
Browse files Browse the repository at this point in the history
  • Loading branch information
jparise committed Feb 4, 2024
1 parent 37b54b4 commit 4b620ef
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vesta/chars.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ def encode_text(
max_cols = COLS - margin * 2
rows: Rows = []

# Find a place to break the line at a `breaks` character that results in
# the longest row possible (up to `max_cols`). The result is a pair of
# positions: the end of the resulting row and the start of the remainder.
def find_break(line: Row) -> Tuple[int, int]:
end = min(len(line), max_cols)
for pos in range(end, 0, -1):
Expand Down

0 comments on commit 4b620ef

Please sign in to comment.