summaryrefslogtreecommitdiff
path: root/core/draw.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/draw.zig')
-rw-r--r--core/draw.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/draw.zig b/core/draw.zig
index 685f67ea..8f690e8e 100644
--- a/core/draw.zig
+++ b/core/draw.zig
@@ -721,7 +721,11 @@ fn tagTintRange(p: *const Pardes, pane: *const Pane, tag: []const u8, prefix_len
} else return null;
const basename = if (std.mem.lastIndexOfScalar(u8, name, '/')) |slash| slash + 1 else 0;
if (basename == name.len) return null;
- return .{ .lo = start + basename, .hi = start + name.len };
+ // A walked file's path cut from its left: a `…` for the bytes it drops
+ // (tagline.folded), never its basename's.
+ const cut = if (pane.file != null) tagline.folded(p, pane).cut else 0;
+ const dots: usize = if (cut > 0) "…".len else 0;
+ return .{ .lo = start + dots + basename - cut, .hi = start + dots + name.len - cut };
}
/// A header or a notice band as a tag layer: `viewport.h` rows, line `top`
@@ -1102,7 +1106,7 @@ fn paintPaneTag(p: *Pardes, s: *Surface, arena: std.mem.Allocator, pane: *Pane,
const ahead = tagline.forwardSpan(p, pane);
if (ahead[0] < ahead[1]) inkTag(p, s, shown, lines[0..rows], top, tx, tag_y, tw, ahead[0], @min(ahead[1], first_line.len), inks.dim, false);
if (pane.file != null and pane.trail.n > 0 and !pardes.Trail.outOfRest(p, pane)) {
- const kept = tagline.folded(p, pane);
+ const kept = tagline.folded(p, pane).whole;
const t = &pane.trail;
const first: usize = @intFromBool(t.steps[0] == .owner);
if (t.isFolded(first, kept)) {