Consistently append newlines regardless of colour mode

pull/474/head
Wilfred Hughes 2023-01-25 16:53:54 +07:00
parent 3291da6be4
commit 6321b8ece2
3 changed files with 9 additions and 3 deletions

@ -1,5 +1,10 @@
## 0.43 (unreleased)
### Display
Fixed an issue with single-column display when colour is disabled,
where newlines were missing from the output.
### Command Line Interface
`--help` now shows the default value for all arguments (it was

@ -340,11 +340,11 @@ pub fn print(
(
split_on_newlines(lhs_src)
.iter()
.map(|s| (*s).to_owned())
.map(|s| format!("{}\n", s))
.collect(),
split_on_newlines(rhs_src)
.iter()
.map(|s| (*s).to_owned())
.map(|s| format!("{}\n", s))
.collect(),
)
};

@ -289,7 +289,8 @@ fn group_by_line(
ranges_by_line
}
/// Apply the `Style`s to the spans specified.
/// Apply the `Style`s to the spans specified. Return a vec of the
/// styled strings, including trailing newlines.
///
/// Tolerant against lines in `s` being shorter than the spans.
fn style_lines(lines: &[&str], styles: &[(SingleLineSpan, Style)]) -> Vec<String> {