refactor: change a -> allocator

This commit is contained in:
CJ van den Berg 2024-09-02 14:31:49 +02:00
parent ad58b1868d
commit 7b812d73ea
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
63 changed files with 896 additions and 896 deletions

View file

@ -27,13 +27,13 @@ last_node: usize = 0,
const Self = @This();
pub fn create(a: Allocator, parent: Plane) !Widget {
pub fn create(allocator: Allocator, parent: Plane) !Widget {
if (tui.current().mainview.dynamic_cast(mainview)) |mv_| if (mv_.get_editor()) |editor| {
const self: *Self = try a.create(Self);
const self: *Self = try allocator.create(Self);
self.* = .{
.plane = try Plane.init(&(Widget.Box{}).opts_vscroll(name), parent),
.editor = editor,
.pos_cache = try ed.PosToWidthCache.init(a),
.pos_cache = try ed.PosToWidthCache.init(allocator),
};
try editor.handlers.add(EventHandler.bind(self, ed_receive));
@ -42,11 +42,11 @@ pub fn create(a: Allocator, parent: Plane) !Widget {
return error.NotFound;
}
pub fn deinit(self: *Self, a: Allocator) void {
pub fn deinit(self: *Self, allocator: Allocator) void {
self.editor.handlers.remove_ptr(self);
tui.current().message_filters.remove_ptr(self);
self.plane.deinit();
a.destroy(self);
allocator.destroy(self);
}
pub fn render(self: *Self, theme: *const Widget.Theme) bool {