summaryrefslogtreecommitdiff
path: root/core/draw.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/draw.zig')
-rw-r--r--core/draw.zig11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/draw.zig b/core/draw.zig
index 68778667..179b7cfc 100644
--- a/core/draw.zig
+++ b/core/draw.zig
@@ -690,6 +690,8 @@ fn joinCells(s: *Surface, x: u16, y: u16, cells: []const Cell, from: usize, w: u
}
fn tagTintRange(p: *const Pardes, pane: *const Pane, tag: []const u8, prefix_len: usize) ?struct { lo: usize, hi: usize } {
+ // Out of rest no name is shown (UX D1).
+ if (pardes.Trail.outOfRest(p, pane)) return null;
if (pane.isTerminal()) {
// `tag` is the first row; a prefix longer than it ran to a second.
var words = std.mem.tokenizeAny(u8, tag[@min(prefix_len, tag.len)..], " \t\r\n");
@@ -700,7 +702,7 @@ fn tagTintRange(p: *const Pardes, pane: *const Pane, tag: []const u8, prefix_len
}
return null;
}
- var start: usize = tagline.nameAt(p, pane);
+ var start: usize = tagline.nameAt(pane);
const name = if (pane.file) |file|
if (pane.prompt == .name) pane.input.own orelse file.path else file.path
else if (pane.addon) |k| blk: {
@@ -1013,7 +1015,7 @@ fn paintPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane,
else if (pane.prompt == .name) caret: {
// A drafted name is the prefix: its caret is on row 0 of the tag,
// the rows it wrapped onto included.
- const at = modal.positionAt(shown.text, shown.fromReal(tagline.nameAt(p, pane) + @as(usize, @intCast(@max(0, pane.input.cur_col)))));
+ const at = modal.positionAt(shown.text, shown.fromReal(tagline.nameAt(pane) + @as(usize, @intCast(@max(0, pane.input.cur_col)))));
if (at.row < top or at.row >= top + rows) break :caret null;
break :caret .{ .row = at.row - top, .at = @min(lines[at.row - top].len, at.col) };
} else if (pane.focus == .tag and pane.prompt == .none and head == null) caret: {
@@ -1031,8 +1033,9 @@ fn paintPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane,
_ = s.print(tx, tag_y + @as(u16, @intCast(row)), tw, line[start..], tag_style);
}
// The pane's progress at its first row's right end, where the row has
- // room for it (SPEC §10.2).
- if (top == 0 and rows > 0) for (p.messages.live[0..p.messages.live_len]) |*said| {
+ // room for it (SPEC §10.2); out of rest the head's right block is
+ // there (UX D1).
+ if (top == 0 and rows > 0 and !pardes.Trail.outOfRest(p, pane)) for (p.messages.live[0..p.messages.live_len]) |*said| {
if (said.kind != .progress or said.pane != pane.serial) continue;
var buf: [Messages.LoggedMessage.cap + 8]u8 = undefined;
const text = std.fmt.bufPrint(&buf, "{s} {s}", .{ Messages.Kind.progress.glyph(), said.words() }) catch break;