From 09c35b22793153d201fa202b52671a6442e5e2e1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sun, 9 Aug 2026 01:26:08 -0300 Subject: a builtin to put the pane taglines at the bottom --- src/file_pane.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/file_pane.zig') diff --git a/src/file_pane.zig b/src/file_pane.zig index 98a72ac4..b06599ae 100644 --- a/src/file_pane.zig +++ b/src/file_pane.zig @@ -277,6 +277,8 @@ pub fn drawGutter(p: *Pardes, pane: *Pane, r: pardes.Rect, tx: u16, tw: u16, bod // the number sits on the first of them, so the whole run lights up — the // gutter is naming the line you are on, and that is still one line const cur_line: i32 = if (active and !pane.tag_edit) gcrow else std.math.minInt(i32); + // the body's first row, the way renderPane derives it (Tagbottom) + const body_y = if (p.tag_bottom) r.y else r.y + pardes.BOX_H; var vr: u16 = 0; while (vr < body_h) : (vr += 1) { const row_line: i32 = if (pane.wrap_n == 0) @@ -285,7 +287,7 @@ pub fn drawGutter(p: *Pardes, pane: *Pane, r: pardes.Rect, tx: u16, tw: u16, bod const on_cursor = row_line == cur_line; var c: u16 = 0; while (c < config.PREFIX_W and c < tw) : (c += 1) { - const cell = s.at(tx + c, r.y + pardes.BOX_H + vr); + const cell = s.at(tx + c, body_y + vr); cell.default = false; // paints blank gutter rows too if (on_cursor) { cell.style.fg = .{ .rgb = ch.tag_fg }; @@ -317,6 +319,7 @@ pub fn recolorSyntax(p: *Pardes, pane: *Pane, f: *File, r: pardes.Rect, tx: u16, // indexed start, same as bodyText — an empty tail simply paints nothing var flines = std.mem.splitScalar(u8, f.content[lineStart(p.gpa, f, f.scroll)..], '\n'); const total = nlines(p.gpa, f); + const body_y = if (p.tag_bottom) r.y else r.y + pardes.BOX_H; var vr: u16 = 0; while (vr < body_h) : (vr += 1) { // A colour has to land on the byte it belongs to, so this walk reads @@ -352,7 +355,7 @@ pub fn recolorSyntax(p: *Pardes, pane: *Pane, f: *File, r: pardes.Rect, tx: u16, const hidx = idx - f.highlight_start; if (hidx >= f.highlights.len) continue; const ss = synStyle(p, @enumFromInt(f.highlights[hidx])) orelse continue; - const cell = s.at(tx + @as(u16, @intCast(config.PREFIX_W + c)), r.y + pardes.BOX_H + vr); + const cell = s.at(tx + @as(u16, @intCast(config.PREFIX_W + c)), body_y + vr); if (cell.default) continue; cell.style.fg = .{ .rgb = ss.fg }; cell.style.bold = ss.bold; -- cgit v1.3