diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-13 11:59:05 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-13 11:59:05 +0200 |
| commit | e8dd842c6699c665225c03e904a40887f8424e30 (patch) | |
| tree | 2bbf1aa10f07eba6f7bab235c917bb9ce92861d9 /src | |
| parent | f7875032b7cec9c53f0c9a2ce9542347cad8f421 (diff) | |
Fix bug with basically empty paragraph
Diffstat (limited to 'src')
| -rw-r--r-- | src/library/text/par.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/library/text/par.rs b/src/library/text/par.rs index d740df03..cf7dc4a9 100644 --- a/src/library/text/par.rs +++ b/src/library/text/par.rs @@ -824,6 +824,19 @@ fn line<'a>( mandatory: bool, hyphen: bool, ) -> Line<'a> { + if range.is_empty() { + return Line { + bidi: &p.bidi, + range, + first: None, + items: &[], + last: None, + width: Length::zero(), + mandatory, + dash: false, + }; + } + // Find the last item. let (last_idx, last_offset) = p.find_idx_and_offset(range.end.saturating_sub(1)).unwrap(); |
