diff options
Diffstat (limited to 'src/edit.zig')
| -rw-r--r-- | src/edit.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/edit.zig b/src/edit.zig index edc86dd2..42032168 100644 --- a/src/edit.zig +++ b/src/edit.zig @@ -131,12 +131,13 @@ pub fn clipYank(p: *Pardes, pane: *Pane, main_only: bool) void { } /// tag + '\n' + body: the full selectable pane text, a row to a screen row -/// (the tag's lines first, as many as it shows) +/// (the tag's lines first, the ones it shows) pub fn paneText(p: *Pardes, pane: *Pane) ![]u8 { const arena = p.scratch.allocator(); const tag = try tagline.tagText(p, arena, pane); - const cut = modal.lineStartOffset(tag, pane.tag_rows); - const shown = if (cut < tag.len) tag[0 .. cut - 1] else tag; + const from = modal.lineStartOffset(tag, pane.tag_top); + const cut = modal.lineStartOffset(tag, pane.tag_top + pane.tag_rows); + const shown = if (cut < tag.len) tag[from .. cut - 1] else tag[from..]; return std.fmt.allocPrint(arena, "{s}\n{s}", .{ shown, try body_layer.bodyText(p, arena, pane) }); } |
