From 542f605d54dcbb37262a00d58074610180c32ae0 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 19 Nov 2023 20:39:33 -0800 Subject: [PATCH] terminal: add explicit errorset to scroll screen --- src/circ_buf.zig | 4 ++-- src/terminal/Screen.zig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/circ_buf.zig b/src/circ_buf.zig index 2cb004c70..4157fd0a4 100644 --- a/src/circ_buf.zig +++ b/src/circ_buf.zig @@ -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. diff --git a/src/terminal/Screen.zig b/src/terminal/Screen.zig index 52b00baea..b764ed4f5 100644 --- a/src/terminal/Screen.zig +++ b/src/terminal/Screen.zig @@ -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();