mirror of
https://github.com/fairyglade/ly.git
synced 2026-11-05 09:41:43 +00:00
Handle termbox2 errors
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
17 files changed
+114
-90
No files matched your search
@@ -105,8 +105,8 @@ pub fn CyclableLabel(comptime ItemType: type, comptime ChangeItemType: type) typ
|
||||
self.current = self.list.items.len - 1;
|
||||
}
|
||||
|
||||
pub fn handle(self: *Self, _: ?keyboard.Key) void {
|
||||
TerminalBuffer.setCursor(
|
||||
pub fn handle(self: *Self, _: ?keyboard.Key) !void {
|
||||
try TerminalBuffer.setCursor(
|
||||
self.component_pos.x + self.cursor + 2,
|
||||
self.component_pos.y,
|
||||
);
|
||||
@@ -119,11 +119,11 @@ pub fn CyclableLabel(comptime ItemType: type, comptime ChangeItemType: type) typ
|
||||
var left_arrow = Cell.init('<', self.fg, self.bg);
|
||||
var right_arrow = Cell.init('>', self.fg, self.bg);
|
||||
|
||||
left_arrow.put(self.component_pos.x, self.component_pos.y);
|
||||
left_arrow.put(self.component_pos.x, self.component_pos.y) catch {};
|
||||
right_arrow.put(
|
||||
self.component_pos.x + self.width - 1,
|
||||
self.component_pos.y,
|
||||
);
|
||||
) catch {};
|
||||
|
||||
const current_item = self.list.items[self.current];
|
||||
const x = self.component_pos.x + 2;
|
||||
|
||||
Reference in new issue
Block a user