Skip to content

Commit

Permalink
Added dev comment
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Oct 5, 2023
1 parent 56ac8f6 commit 75268be
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/content_and_search_result_render.ml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ let render_grid
| [] -> (new_len, [ [ word ] ])
| line :: rest -> (
if new_len > content_width then (
(* If the terminal width is really small,
then this new line may still overflow visually.
But since we still need to put this one word somewhere eventually,
it might as well be here as a line with a single
word.
Otherwise we just get an infinite loop where we keep trying
to find a non-existent sufficiently spacious line to put the word.
*)
(word_len, [ word ] :: acc)
) else (
(new_len, (word :: line) :: rest)
Expand Down

0 comments on commit 75268be

Please sign in to comment.