a modern tui library written in zig
18
fork

Configure Feed

Select the types of activity you want to include in your feed.

screen: add error union to return type

+3 -5
+1 -1
src/Screen.zig
··· 29 mouse_shape: Shape = .default, 30 cursor_shape: Cell.CursorShape = .default, 31 32 - pub fn init(alloc: std.mem.Allocator, winsize: Winsize, unicode: *const Unicode) !Screen { 33 const w = winsize.cols; 34 const h = winsize.rows; 35 const self = Screen{
··· 29 mouse_shape: Shape = .default, 30 cursor_shape: Cell.CursorShape = .default, 31 32 + pub fn init(alloc: std.mem.Allocator, winsize: Winsize, unicode: *const Unicode) std.mem.Allocator.Error!Screen { 33 const w = winsize.cols; 34 const h = winsize.rows; 35 const self = Screen{
+2 -4
src/View.zig
··· 25 }; 26 27 /// Initialize a new View 28 - pub fn init(alloc: mem.Allocator, unicode: *const Unicode, config: Config) !View { 29 const screen = try Screen.init( 30 alloc, 31 .{ ··· 115 x = @min(x, self.screen.width -| width); 116 y = @min(y, self.screen.height -| height); 117 const child = win.child(.{ 118 - .x_off = x, 119 - .y_off = y, 120 .width = .{ .limit = width }, 121 .height = .{ .limit = height }, 122 }); 123 - self.draw(child, .{}); 124 return .{ x, y }; 125 } 126
··· 25 }; 26 27 /// Initialize a new View 28 + pub fn init(alloc: mem.Allocator, unicode: *const Unicode, config: Config) mem.Allocator.Error!View { 29 const screen = try Screen.init( 30 alloc, 31 .{ ··· 115 x = @min(x, self.screen.width -| width); 116 y = @min(y, self.screen.height -| height); 117 const child = win.child(.{ 118 .width = .{ .limit = width }, 119 .height = .{ .limit = height }, 120 }); 121 + self.draw(child, .{ .x_off = x, .y_off = y }); 122 return .{ x, y }; 123 } 124