From d5e0565cbfa47acde98d41d8777ace5d1bc4d690 Mon Sep 17 00:00:00 2001 From: Thomas Otto Date: Tue, 26 Nov 2024 20:19:46 +0100 Subject: Styled zero lines fix With `interactive.diffFilter = delta --color-only` delta is called by e.g. `git add -p`, but in this mode git hides the terminal from the pager. Plus/minus lines correctly use ANSI sequences to paint up to to the end of the line, but zero lines always use spaces. This needs the terminal width, but it is not available for diffFilter. So the fallback of 80 is used, and zero styles did not extend to the full terminal width. Since zero lines are only rarely styled (e.g. via `--zero-style='syntax "#1d1f21" dim'`), this was never noticed. This also crashed delta when a zero line was longer than 80. --- src/paint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/paint.rs') diff --git a/src/paint.rs b/src/paint.rs index aaa53e5..474ea08 100644 --- a/src/paint.rs +++ b/src/paint.rs @@ -204,7 +204,7 @@ impl<'p> Painter<'p> { self.config, &mut self.line_numbers_data.as_mut(), None, - BgShouldFill::With(BgFillMethod::Spaces), + BgShouldFill::default(), ); } } -- cgit v1.2.3