Skip to content

Commit

Permalink
Merge pull request mgeisler#221 from mgeisler/fragments-and-words
Browse files Browse the repository at this point in the history
Reformulate wrapping in terms of boxes, glue, and penalties
  • Loading branch information
mgeisler authored Nov 8, 2020
2 parents fe5b491 + 1fc0ba3 commit 52c39c3
Show file tree
Hide file tree
Showing 5 changed files with 803 additions and 367 deletions.
2 changes: 1 addition & 1 deletion examples/interactive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mod unix_only {
)?;
row += 2;

let mut lines = wrap(text, options).collect::<Vec<_>>();
let mut lines = wrap(text, options);
if let Some(line) = lines.last() {
// If `text` ends with a newline, the final wrapped line
// contains this newline. This will in turn leave the
Expand Down
2 changes: 1 addition & 1 deletion examples/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() {

for width in 15..60 {
options.width = width;
let lines = wrap(example, &options).collect::<Vec<_>>();
let lines = wrap(example, &options);
if lines != prev_lines {
let title = format!(" Width: {} ", width);
println!(".{:-^1$}.", title, width + 2);
Expand Down
Loading

0 comments on commit 52c39c3

Please sign in to comment.