diff options
| author | Gabriel Schneider <[email protected]> | 2026-08-09 01:26:08 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-10 09:17:07 -0300 |
| commit | 09c35b22793153d201fa202b52671a6442e5e2e1 (patch) | |
| tree | 1eb84c955dc96f4c6bcb75b36f6113ccad8e2f1e /src/file_pane.zig | |
| parent | 475cc49ccbe9e81f8ec8aa2371c20fc632d110b9 (diff) | |
| download | pardes-09c35b22793153d201fa202b52671a6442e5e2e1.tar.gz pardes-09c35b22793153d201fa202b52671a6442e5e2e1.zip | |
a builtin to put the pane taglines at the bottom
Diffstat (limited to 'src/file_pane.zig')
| -rw-r--r-- | src/file_pane.zig | 7 |
1 files changed, 5 insertions, 2 deletions
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; |
