terminal: add explicit errorset to scroll screen

This commit is contained in:
Mitchell Hashimoto
2023-11-19 20:39:33 -08:00
parent a8579c1d5d
commit 542f605d54
2 changed files with 4 additions and 4 deletions

View File

@ -93,7 +93,7 @@ pub fn CircBuf(comptime T: type, comptime default: T) type {
/// Resize the buffer to the given size (larger or smaller).
/// If larger, new values will be set to the default value.
pub fn resize(self: *Self, alloc: Allocator, size: usize) !void {
pub fn resize(self: *Self, alloc: Allocator, size: usize) Allocator.Error!void {
// Rotate to zero so it is aligned.
try self.rotateToZero(alloc);
@ -116,7 +116,7 @@ pub fn CircBuf(comptime T: type, comptime default: T) type {
}
/// Rotate the data so that it is zero-aligned.
fn rotateToZero(self: *Self, alloc: Allocator) !void {
fn rotateToZero(self: *Self, alloc: Allocator) Allocator.Error!void {
// TODO: this does this in the worst possible way by allocating.
// rewrite to not allocate, its possible, I'm just lazy right now.

View File

@ -1794,7 +1794,7 @@ pub const Scroll = union(enum) {
/// "move" the screen. It is up to the caller to determine if they actually
/// want to do that yet (i.e. are they writing to the end of the screen
/// or not).
pub fn scroll(self: *Screen, behavior: Scroll) !void {
pub fn scroll(self: *Screen, behavior: Scroll) Allocator.Error!void {
// No matter what, scrolling marks our image state as dirty since
// it could move placements. If there are no placements or no images
// this is still a very cheap operation.
@ -1830,7 +1830,7 @@ fn scrollRow(self: *Screen, idx: RowIndex) void {
assert(screen_pt.inViewport(self));
}
fn scrollDelta(self: *Screen, delta: isize, viewport_only: bool) !void {
fn scrollDelta(self: *Screen, delta: isize, viewport_only: bool) Allocator.Error!void {
const tracy = trace(@src());
defer tracy.end();