summaryrefslogtreecommitdiff
path: root/anim/src/Recording.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/Recording.zig')
-rw-r--r--anim/src/Recording.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/anim/src/Recording.zig b/anim/src/Recording.zig
index 280d14a..41619aa 100644
--- a/anim/src/Recording.zig
+++ b/anim/src/Recording.zig
@@ -210,6 +210,14 @@ pub fn lineOf(r: *const Recording, addr: u64) ?u32 {
return if (addr - near.addr <= 96) near.line else null;
}
+/// The line of the program's own source moment `i` is on; null where it is
+/// elsewhere (a library's code, a stop with no line).
+pub fn ownLine(r: *const Recording, i: u64) ?u32 {
+ const l = r.lines[@min(i, r.end())];
+ if (l.line == 0 or !std.mem.eql(u8, std.fs.path.basename(r.name(l.file)), r.file)) return null;
+ return l.line;
+}
+
/// The first line a source panel of `fit` lines shows when the program is
/// on `line`: the whole file when it fits; else a window that has the line
/// in its middle third, and is the same window for every line of that