summaryrefslogtreecommitdiff
path: root/core/draw.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/draw.zig')
-rw-r--r--core/draw.zig21
1 files changed, 19 insertions, 2 deletions
diff --git a/core/draw.zig b/core/draw.zig
index f69f83c6..be4230c4 100644
--- a/core/draw.zig
+++ b/core/draw.zig
@@ -903,7 +903,8 @@ fn joinBand(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane, r: R
}
for (ln.parts) |part| {
const end = @min(columns, part.col + part.width);
- if (part.row.on and part.col < end) t.tint(part.col, row, end - part.col, th.tag_sel_bg orelse th.sel_bg, th.sel_fg);
+ // The cursor's row across its step's width, its lead too (UX D5).
+ if (part.row.on and part.col < end) t.tint(part.col -| 2, row, end - (part.col -| 2), th.tag_sel_bg orelse th.sel_bg, th.sel_fg);
var c = part.col;
var b: usize = 0;
while (b < part.row.text.len and c < end) : (c += 1) {
@@ -999,7 +1000,11 @@ fn paintPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane,
var lines: [MAX_TAG_ROWS][]const u8 = @splat("");
var split = std.mem.splitScalar(u8, shown.text, '\n');
for (0..top) |_| _ = split.next();
- for (lines[0..rows]) |*line| line.* = split.next() orelse "";
+ var nlines: usize = 0;
+ for (lines[0..rows]) |*line| {
+ line.* = split.next() orelse continue;
+ nlines += 1;
+ }
// The keyboard's caret, as a row and a byte offset in that row's
// line: in the tag's own text when the tag has the keyboard, in the
// path while a name is drafted.
@@ -1026,6 +1031,18 @@ fn paintPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane,
const start = @min(line.len, panes.File.rawAtDisplay(p.settings.tab, line, pane.tag_scroll));
_ = s.print(tx, tag_y + @as(u16, @intCast(row)), tw, line[start..], tag_style);
}
+ // Out of rest the rows the tag keeps from rest under the head's own:
+ // the spines on through them, under the key cells (UX D5).
+ if (head) |h| if (top == 0 and nlines < rows and h.cells > 0) {
+ const first = lines[0];
+ for (h.spans[0..h.cells]) |cell| {
+ const at = prefix_len + cell.lo;
+ if (at > first.len) break;
+ const col = panes.File.rawDisplayCol(p.settings.tab, first, at);
+ if (col >= tw) break;
+ for (nlines..rows) |row| s.set(tx + @as(u16, @intCast(col)), tag_y + @as(u16, @intCast(row)), "│", .{ .fg = .{ .rgb = chrome.box }, .bg = .{ .rgb = tag_bg }, .font_role = .tagline }); // P2: the rule role (UX D4)
+ }
+ };
// The pane's progress at its first row's right end, where the row has
// room for it (SPEC §10.2); out of rest the head's right block is
// there (UX D1).