summaryrefslogtreecommitdiff
path: root/core/draw.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/draw.zig')
-rw-r--r--core/draw.zig9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/draw.zig b/core/draw.zig
index 419b3a84..8198e2ff 100644
--- a/core/draw.zig
+++ b/core/draw.zig
@@ -106,7 +106,7 @@ pub fn place(p: *Pardes, s: *Surface) void {
// A folded pane is its tag rows and nothing else.
if (pane.collapsed) continue;
const body_h = r.h -| pane.tag_rows;
- const line: i32 = if (pane.file) |f| @intCast(@min(f.scroll, std.math.maxInt(i32))) else if (pane.isTerminal()) @intCast(panes.Term.grid(pane.terminal).offset) else 0;
+ const line: i32 = if (pane.file) |f| @intCast(@min(f.scroll, std.math.maxInt(i32))) else if (pane.isTerminal()) @intCast(pane.termTop()) else 0;
// The text it shows, for a frontend's glide to tell apart: a file's
// path, a generated text's revision with it (rows rewritten as its
// view moved are another text's); none for a terminal or a picture.
@@ -122,7 +122,7 @@ pub fn place(p: *Pardes, s: *Surface) void {
.len = pane.rows,
} else blk: {
const grid = panes.Term.grid(pane.terminal);
- break :blk .{ .total = grid.total, .offset = grid.offset, .len = grid.len };
+ break :blk .{ .total = grid.total, .offset = pane.termTop(), .len = grid.len };
};
const track_h: usize = body_h;
const total = if (sb.total == 0) 1 else sb.total;
@@ -372,9 +372,8 @@ pub fn render(p: *Pardes, arena: std.mem.Allocator) !*Surface {
sb_off = 0;
sb_total = 0;
} else {
- const grid = panes.Term.grid(at.terminal);
- sb_off = grid.offset;
- sb_total = grid.total;
+ sb_off = at.termTop();
+ sb_total = panes.Term.grid(at.terminal).total;
}
const effective_font = p.settings.font.effective_name.get();
const font_name = if (effective_font.len == 0) "default" else effective_font;