summaryrefslogtreecommitdiff
path: root/src/draw.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw.zig')
-rw-r--r--src/draw.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/draw.zig b/src/draw.zig
index fe4921ff..75d6378b 100644
--- a/src/draw.zig
+++ b/src/draw.zig
@@ -7,7 +7,6 @@ const std = @import("std");
const vaxis = @import("vaxis");
const pardes = @import("pardes.zig");
const layout = @import("layout.zig");
-const animation = @import("animation.zig");
const config = @import("config.zig");
const panes = @import("panes.zig");
const modal = @import("modal.zig");
@@ -61,7 +60,11 @@ pub fn place(p: *Pardes, s: *Surface) void {
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()) panes.terminal.gridOffset(pane) else 0;
- s.addRegion(.{ .kind = .body, .owner = owner, .serial = pane.serial, .active = active, .line = line, .rect = .{ .x = r.x + config.GUTTER, .y = body_y, .w = r.w - config.GUTTER, .h = body_h } });
+ // 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.
+ const doc: u64 = if (pane.file) |f| std.hash.Wyhash.hash(if (f.output != null) f.revision else 0, f.path) else 0;
+ s.addRegion(.{ .kind = .body, .owner = owner, .serial = pane.serial, .active = active, .line = line, .doc = doc, .rect = .{ .x = r.x + config.GUTTER, .y = body_y, .w = r.w - config.GUTTER, .h = body_h } });
var rail: Region = .{ .kind = .rail, .owner = owner, .serial = pane.serial, .active = active, .rect = .{ .x = r.x, .y = body_y, .w = config.GUTTER, .h = body_h } };
// An image's rail has no thumb; a native PDF's is measured as its
// pages are placed (Pdf.draw); every other pane's is here.