delta
delta copied to clipboard
π side-by-side does not apply zero-styles for empty lines
[delta]
features = side-by-side line-numbers decorations
zero-style = syntax "#EEEEEE"
When using side-by-side with a terminal background color overriding, the color does not apply to empty lines.
Hi @elbaro, thanks for this and sorry I didn't respond at the time you opened it. It's an interesting point -- I think the issue, at least in part, is that delta has so far been designed for the background colors to be used for emphasis. But it is not doing well, as you say, if you try to use delta to supply the default background color everywhere (I had imagined that users would use their terminal emulator to set the default background color).
Delta emphasizes the whole line 87 in the screenshot instead of only the text part "assert window_size > 0". Doesn't that mean we should color the whole line 88 because the line is emphasized?
One problem relying on terminal background is remote machines. When delta is installed on the remote server, I sometimes ssh to it via dark terminal and sometimes light terminal.
Hi @elbaro, can you post
- An example diff that demonstrates the problem
- The command line you are using and the output of
delta --show-config
- Your delta version?
I tried to reproduce it with this diff:
diff --git a/src/cli.rs b/src/cli.rs
index e047889..6794917 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -320,7 +320,7 @@ pub struct Opt {
pub color_only: bool,
pub features: String,
But that seems to work correctly:
delta --no-gitconfig --side-by-side --zero-style='black white' < the_diff.diff
![]() |
Please make sure you're using the latest version of delta -- the implementation of side-by-side was rewritten this year, and I think that this bug may have been fixed already.
@dandavison @elbaro Hi. I am having the same problem with the latest version.
β― delta --version
delta 0.13.0
This occurs under the following conditions:
- use side-by-side
- line-numbers-zero-style via features
for example:
[delta]
side-by-side = true
features = line-numbers-style
[delta "line-numbers-style"]
line-numbers = true
line-numbers-zero-style = "#ffffff" # doesn't work

but this is works:
[delta]
side-by-side = true
line-numbers = true
line-numbers-zero-style = "#ffffff" # ok

I found that works when side-by-side
and zero-style
placed in the same feature.
[delta]
features = line-numbers-style
[delta "line-numbers-style"]
side-by-side = true
line-numbers = true
line-numbers-zero-style = "#ffffff"
