mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Add helper functions for finding root
This commit is contained in:
@ -264,6 +264,13 @@ extension Ghostty {
|
||||
return weight
|
||||
}
|
||||
|
||||
/// Returns the top most parent, or this container. Because this
|
||||
/// would fall back to use to self, the return value is guaranteed.
|
||||
func rootContainer() -> Container {
|
||||
guard let parent = self.parent else { return self }
|
||||
return parent.rootContainer()
|
||||
}
|
||||
|
||||
// MARK: - Hashable
|
||||
|
||||
func hash(into hasher: inout Hasher) {
|
||||
|
Reference in New Issue
Block a user