diff options
Diffstat (limited to 'core/Core.zig')
| -rw-r--r-- | core/Core.zig | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/Core.zig b/core/Core.zig index 11f254ab..5ce635f2 100644 --- a/core/Core.zig +++ b/core/Core.zig @@ -2028,6 +2028,15 @@ pub fn sync(p: *Pardes) void { caret_row = std.mem.count(u8, shown.text[0..@min(shown.fromReal(cur), shown.text.len)], "\n"); } if (!pane.tag_expanded) wanted = 1; + // Out of rest the head is the tag's text (TagState), and the tag + // keeps the rows its own text takes at least: a head shorter than + // it (a root's key cell, before its level shows) moved the body up + // and back down a moment later; a terminal's exactly those, its pty + // its body (a resize the program under it saw at every C-w and SPC). + if (pardes.TagState.hostOf(p) == id) { + const rest = layout.wantedTagRows(p, id); + wanted = if (pane.isTerminal()) rest else @max(wanted, rest); + } pane.tag_rows = @intCast(@min(wanted, MAX_TAG_ROWS, @max(BOX_H, r.h -| 1))); if (pane.collapsed) pane.tag_rows = BOX_H; if (pane.focus == .tag and pane.prompt != .name) { @@ -2035,7 +2044,7 @@ pub fn sync(p: *Pardes) void { var top: usize = pane.tag_top; if (cur < top) top = cur; if (cur >= top + pane.tag_rows) top = cur + 1 - pane.tag_rows; - pane.tag_top = @intCast(@min(top, lines - pane.tag_rows)); + pane.tag_top = @intCast(@min(top, lines -| pane.tag_rows)); } 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. |
