Fix duplicate newlines in inline display mode

Fixes #314
pull/315/head
Wilfred Hughes 2022-07-10 20:27:39 +07:00
parent 75fe85017b
commit 2071517621
2 changed files with 9 additions and 4 deletions

@ -1,5 +1,10 @@
## 0.31 (unreleased)
### Display
Fixed an issue with inline mode where there was a blank line between
every line.
## 0.30 (released 4th July 2022)
### Parsing

@ -82,7 +82,7 @@ pub fn print(
for (lhs_line, _) in before_lines {
if let Some(lhs_line) = lhs_line {
println!(
print!(
"{} {}",
format_line_num(lhs_line),
lhs_colored_lines[lhs_line.as_usize()]
@ -92,7 +92,7 @@ pub fn print(
for (lhs_line, _) in &hunk_lines {
if let Some(lhs_line) = lhs_line {
println!(
print!(
"{} {}",
format_line_num(*lhs_line).red().bold(),
lhs_colored_lines[lhs_line.as_usize()]
@ -101,7 +101,7 @@ pub fn print(
}
for (_, rhs_line) in &hunk_lines {
if let Some(rhs_line) = rhs_line {
println!(
print!(
" {}{}",
format_line_num(*rhs_line).green().bold(),
rhs_colored_lines[rhs_line.as_usize()]
@ -111,7 +111,7 @@ pub fn print(
for (_, rhs_line) in &after_lines {
if let Some(rhs_line) = rhs_line {
println!(
print!(
" {}{}",
format_line_num(*rhs_line),
rhs_colored_lines[rhs_line.as_usize()]