From 30fea9ecec017728f2c33ca07627ff759b5a4871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Wed, 7 Oct 2026 00:28:26 -0400 Subject: [PATCH] =?UTF-8?q?Git=20=C2=B7=20DiffViewer:=20rows=20share=20the?= =?UTF-8?q?=20hunk=20button's=20height,=20so=20washes=20meet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/git/viewer.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/git/viewer.rs b/src/git/viewer.rs index 8977cc1..b2358eb 100644 --- a/src/git/viewer.rs +++ b/src/git/viewer.rs @@ -276,6 +276,10 @@ impl RenderOnce for DiffViewer { .len() .max(2); let (id, on_open) = (self.id.clone(), self.on_open.clone()); + let (button, button_height) = ( + self.hunk_action.is_some(), + theme.control_height(ControlSize::Sm), + ); let (selected, on_line, hunk_action) = ( self.selected.clone(), self.on_line.clone(), @@ -342,7 +346,9 @@ impl RenderOnce for DiffViewer { let element = div() .flex_1() .min_w_0() + .h_full() .flex() + .items_center() .gap_2() .overflow_hidden() .when_some(wash, |side, wash| side.bg(wash)) @@ -366,7 +372,9 @@ impl RenderOnce for DiffViewer { .border_1() .border_color(transparent_black()) .whitespace_nowrap() - .line_height(relative(LEADING)); + .line_height(relative(LEADING)) + // Rows share one height; the hunk button sets it. + .when(button, |row| row.h(button_height).items_center()); match &rows[ix] { Shown::Header(stretch, header) => { let action = hunk_action.clone().map(|(label, run)| {