Remove use of deprecated aliases/types + use upstream zigini

Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
AnErrupTion
2025-03-16 22:45:46 +01:00
parent 13ba52319c
commit 9ded9fd765
6 changed files with 17 additions and 17 deletions

View File

@@ -3,7 +3,7 @@ const interop = @import("../../interop.zig");
const TerminalBuffer = @import("../TerminalBuffer.zig");
const Allocator = std.mem.Allocator;
const DynamicString = std.ArrayList(u8);
const DynamicString = std.ArrayListUnmanaged(u8);
const termbox = interop.termbox;
@@ -22,7 +22,7 @@ masked: bool,
maybe_mask: ?u32,
pub fn init(allocator: Allocator, buffer: *TerminalBuffer, masked: bool, maybe_mask: ?u32) Text {
const text = DynamicString.init(allocator);
const text: DynamicString = .empty;
return .{
.allocator = allocator,
@@ -39,8 +39,8 @@ pub fn init(allocator: Allocator, buffer: *TerminalBuffer, masked: bool, maybe_m
};
}
pub fn deinit(self: Text) void {
self.text.deinit();
pub fn deinit(self: *Text) void {
self.text.deinit(self.allocator);
}
pub fn position(self: *Text, x: usize, y: usize, visible_length: usize) void {
@@ -153,7 +153,7 @@ fn backspace(self: *Text) void {
fn write(self: *Text, char: u8) !void {
if (char == 0) return;
try self.text.insert(self.cursor, char);
try self.text.insert(self.allocator, self.cursor, char);
self.end += 1;
self.goRight();