diff options
Diffstat (limited to 'core/Core.zig')
| -rw-r--r-- | core/Core.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/Core.zig b/core/Core.zig index 2c04cc64..5b6eba75 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -2010,7 +2010,10 @@ pub fn sync(p: *Pardes) void { var wrap_fba = std.heap.FixedBufferAllocator.init(&wrap_room); const wa = wrap_fba.allocator(); const prefix: ?[]const u8 = tagline.prefixIn(p, wa, pane) catch null; - const lead = if (prefix) |made| made.len else pane.tag_lead; + // The tag's cursor and selections are offsets in its text at rest: + // a head shown over its own text moves none of them (UX D1). + const at_rest = if (pardes.Trail.outOfRest(p, pane)) tagline.restPrefix(p, wa, pane) catch null else prefix; + const lead = if (at_rest) |made| made.len else pane.tag_lead; if (lead != pane.tag_lead) { const t = &pane.tag; const old: i32 = @intCast(pane.tag_lead); @@ -2059,7 +2062,8 @@ pub fn sync(p: *Pardes) void { } else pane.tag_top = 0; // The band unrolled under the tag's text pushes the body down: // the tag's rows, as everything under them counts them. - pane.band_rows = if (pane.collapsed) 0 else @min(pardes.Band.takes(p, id), r.h -| pane.tag_rows); + // A terminal's or a kind's is drawn over its body instead (Band.over). + pane.band_rows = if (pane.collapsed or pardes.Band.over(pane)) 0 else @min(pardes.Band.takes(p, id), r.h -| pane.tag_rows -| pardes.Band.body_rows); pane.tag_rows += pane.band_rows; const cols = @max(1, r.w -| config.GUTTER); // The tag steals the top rows. The pty is what the pane shows |
