Update to Zig 0.16.0 (#962)

Signed-off-by: AnErrupTion <anerruption@disroot.org>

## What are the changes about?

Ports the code base to Zig 0.16.0.

## What existing issue does this resolve?

N/A

## Pre-requisites

- [x] I have tested & confirmed the changes work locally
- [x] I have run `zig fmt` throughout my changes

Reviewed-on: https://codeberg.org/fairyglade/ly/pulls/962
This commit is contained in:
AnErrupTion
2026-04-25 17:37:34 +02:00
committed by AnErrupTion
parent eec83179b9
commit 5edf5251f6
26 changed files with 751 additions and 587 deletions

View File

@@ -29,6 +29,7 @@ keybinds: TerminalBuffer.KeybindMap,
pub fn init(
allocator: Allocator,
io: std.Io,
buffer: *TerminalBuffer,
should_insert: bool,
masked: bool,
@@ -57,11 +58,11 @@ pub fn init(
.keybinds = .init(allocator),
};
try buffer.registerKeybind(&self.keybinds, "Left", &goLeft, self);
try buffer.registerKeybind(&self.keybinds, "Right", &goRight, self);
try buffer.registerKeybind(&self.keybinds, "Delete", &delete, self);
try buffer.registerKeybind(&self.keybinds, "Backspace", &backspace, self);
try buffer.registerKeybind(&self.keybinds, "Ctrl+U", &clearTextEntry, self);
try buffer.registerKeybind(io, &self.keybinds, "Left", &goLeft, self);
try buffer.registerKeybind(io, &self.keybinds, "Right", &goRight, self);
try buffer.registerKeybind(io, &self.keybinds, "Delete", &delete, self);
try buffer.registerKeybind(io, &self.keybinds, "Backspace", &backspace, self);
try buffer.registerKeybind(io, &self.keybinds, "Ctrl+U", &clearTextEntry, self);
return self;
}

View File

@@ -32,6 +32,7 @@ pub fn CyclableLabel(comptime ItemType: type, comptime ChangeItemType: type) typ
pub fn init(
allocator: Allocator,
io: std.Io,
buffer: *TerminalBuffer,
draw_item_fn: DrawItemFn,
change_item_fn: ?ChangeItemFn,
@@ -60,10 +61,10 @@ pub fn CyclableLabel(comptime ItemType: type, comptime ChangeItemType: type) typ
.keybinds = .init(allocator),
};
try buffer.registerKeybind(&self.keybinds, "Left", &goLeft, self);
try buffer.registerKeybind(&self.keybinds, "Ctrl+H", &goLeft, self);
try buffer.registerKeybind(&self.keybinds, "Right", &goRight, self);
try buffer.registerKeybind(&self.keybinds, "Ctrl+L", &goRight, self);
try buffer.registerKeybind(io, &self.keybinds, "Left", &goLeft, self);
try buffer.registerKeybind(io, &self.keybinds, "Ctrl+H", &goLeft, self);
try buffer.registerKeybind(io, &self.keybinds, "Right", &goRight, self);
try buffer.registerKeybind(io, &self.keybinds, "Ctrl+L", &goRight, self);
return self;
}