mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-18 05:20:29 +00:00
bind is-split property between split_tree class and surface class
This commit is contained in:
@@ -507,16 +507,12 @@ pub fn SplitTree(comptime V: type) type {
|
||||
// We need to increase the reference count of all the nodes.
|
||||
try refNodes(gpa, nodes);
|
||||
|
||||
const result: Self = .{
|
||||
return .{
|
||||
.arena = arena,
|
||||
.nodes = nodes,
|
||||
// Splitting always resets zoom state.
|
||||
.zoomed = null,
|
||||
};
|
||||
|
||||
result.updateNodesNumberSiblings();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Remove a node from the tree.
|
||||
@@ -560,8 +556,6 @@ pub fn SplitTree(comptime V: type) type {
|
||||
// Increase the reference count of all the nodes.
|
||||
try refNodes(gpa, nodes);
|
||||
|
||||
result.updateNodesNumberSiblings();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -871,14 +865,6 @@ pub fn SplitTree(comptime V: type) type {
|
||||
};
|
||||
}
|
||||
|
||||
/// Set the number of siblings for each split in the tree
|
||||
fn updateNodesNumberSiblings(self: *const Self) void {
|
||||
var it = self.iterator();
|
||||
while (it.next()) |entry| {
|
||||
entry.view.setNSiblings(self.nodes.len - 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// Spatial representation of the split tree. See spatial.
|
||||
pub const Spatial = struct {
|
||||
/// The slots of the spatial representation in the same order
|
||||
|
||||
Reference in New Issue
Block a user