mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-17 07:16:12 +00:00
terminal: sliding window search starts working
This commit is contained in:
@@ -45,6 +45,17 @@ pub fn CircBuf(comptime T: type, comptime default: T) type {
|
||||
self.idx += 1;
|
||||
return &self.buf.storage[storage_idx];
|
||||
}
|
||||
|
||||
/// Seek the iterator by a given amount. This will clamp
|
||||
/// the values to the bounds of the buffer so overflows are
|
||||
/// not possible.
|
||||
pub fn seekBy(self: *Iterator, amount: isize) void {
|
||||
if (amount > 0) {
|
||||
self.idx +|= @intCast(amount);
|
||||
} else {
|
||||
self.idx -|= @intCast(@abs(amount));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/// Initialize a new circular buffer that can store size elements.
|
||||
|
Reference in New Issue
Block a user