refactor: convert local ArrayList to ArrayListUnmanaged in editor

This commit is contained in:
CJ van den Berg 2025-05-27 21:43:57 +02:00
parent b1cb25d335
commit 1258d76986
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 96 additions and 81 deletions

View file

@ -250,9 +250,9 @@ fn open_style_config(self: *Self, Style: type) command.Result {
break :blk .{ style, style_bufs };
} else .{ Style{}, &.{} };
defer root.free_config(self.allocator, style_bufs);
var conf = std.ArrayList(u8).init(self.allocator);
defer conf.deinit();
root.write_config_to_writer(Style, style, conf.writer()) catch {};
var conf = std.ArrayListUnmanaged(u8).empty;
defer conf.deinit(self.allocator);
root.write_config_to_writer(Style, style, conf.writer(self.allocator)) catch {};
tui.reset_drag_context();
try self.create_editor();
try command.executeName("open_scratch_buffer", command.fmt(.{