mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Add pin order assertion in Pin.pageIterator
This commit is contained in:

committed by
Jonathan Lopez

parent
995bc54639
commit
bd3c4ad4e8
@ -3413,6 +3413,16 @@ pub const Pin = struct {
|
||||
direction: Direction,
|
||||
limit: ?Pin,
|
||||
) PageIterator {
|
||||
if (build_config.slow_runtime_safety) {
|
||||
if (limit) |l| {
|
||||
// Check the order according to the iteration direction.
|
||||
switch (direction) {
|
||||
.right_down => assert(self.eql(l) or self.before(l)),
|
||||
.left_up => assert(self.eql(l) or l.before(self)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return .{
|
||||
.row = self,
|
||||
.limit = if (limit) |p| .{ .row = p } else .{ .none = {} },
|
||||
|
Reference in New Issue
Block a user