Ensure side-by-side-show-both always uses two columns

Fixes #812
pull/813/head
Wilfred Hughes 2025-02-07 09:03:10 +07:00
parent e83fd336a2
commit 17e6a54294
2 changed files with 17 additions and 2 deletions

@ -4,6 +4,11 @@
When diffing directories, difftastic now ignores the `.git` directory.
### Display
Fixed an issue where `--display=side-by-side-show-both` would not use
a two-column display when one file was empty.
### Command Line Interface
Difftastic no longer accepts the `--missing-as-empty`. This has had no

@ -388,7 +388,12 @@ pub(crate) fn print(
.map(|l| replace_tabs(l, display_options.tab_width))
.collect();
if lhs_src.is_empty() {
if lhs_src.is_empty()
&& !matches!(
display_options.display_mode,
DisplayMode::SideBySideShowBoth
)
{
for line in display_single_column(
display_path,
old_path,
@ -402,7 +407,12 @@ pub(crate) fn print(
println!();
return;
}
if rhs_src.is_empty() {
if rhs_src.is_empty()
&& !matches!(
display_options.display_mode,
DisplayMode::SideBySideShowBoth
)
{
for line in display_single_column(
display_path,
old_path,