aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/datastruct/split_tree.zig
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/libghostty-vt/src/datastruct/split_tree.zig')
-rw-r--r--vendor/libghostty-vt/src/datastruct/split_tree.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/datastruct/split_tree.zig b/vendor/libghostty-vt/src/datastruct/split_tree.zig
index 1dc924ca..012f107f 100644
--- a/vendor/libghostty-vt/src/datastruct/split_tree.zig
+++ b/vendor/libghostty-vt/src/datastruct/split_tree.zig
@@ -183,6 +183,18 @@ pub fn SplitTree(comptime V: type) type {
};
}
+ /// Find the handle within this tree that corresponds
+ /// to the given view. Uses pointer equality.
+ pub fn locate(self: *const Self, view: *const View) ?Node.Handle {
+ var it = self.iterator();
+ while (it.next()) |entry| {
+ if (entry.view == view) {
+ return entry.handle;
+ }
+ }
+ return null;
+ }
+
/// An iterator over all the views in the tree.
pub fn iterator(
self: *const Self,