From 96725011b43d7bf56ac02e710ea4ef4a76f05351 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 15 Sep 2026 16:44:18 -0300 Subject: Make location highlighting an explicit output producer choice --- src/pardes.zig | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/pardes.zig') diff --git a/src/pardes.zig b/src/pardes.zig index 56f95040..25f4e18e 100644 --- a/src/pardes.zig +++ b/src/pardes.zig @@ -13827,17 +13827,14 @@ pub const Pardes = struct { } const tz_color = tracy.zone(@src(), "paneRecolor"); - switch (pane.colorAlgo()) { - .tty => if (p.settings.colors) panes.Terminal.recolorAnsi(p, pane, r, tx, tw, body_h, body), - // `.locations` joins them because it feeds the same `f.highlights` - // — only the pass that FILLED it differs (refreshHighlights). - .source, .diff, .locations => { - const f = &pane.file.?; - panes.File.drawGutter(p, pane, r, tx, tw, body_h, active); - if (p.settings.colors) panes.File.recolorSyntax(p, pane, f, r, tx, tw, body_h); - panes.File.drawWrapMarkers(p, pane, r, tx, tw, body_h, pane_bg); - }, - .none => {}, + // File layout is independent of whether its producer requests colors. + if (pane.file) |*f| { + panes.File.drawGutter(p, pane, r, tx, tw, body_h, active); + if (p.settings.colors and pane.colorAlgo() != .none) + panes.File.recolorSyntax(p, pane, f, r, tx, tw, body_h); + panes.File.drawWrapMarkers(p, pane, r, tx, tw, body_h, pane_bg); + } else if (pane.isTerminal() and p.settings.colors) { + panes.Terminal.recolorAnsi(p, pane, r, tx, tw, body_h, body); } tz_color.end(); -- cgit v1.3