refactor: add vcs_id and vcs_content fields to Buffer

This commit is contained in:
CJ van den Berg 2025-12-15 20:41:36 +01:00
parent a561de6602
commit 0143a7148a
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -47,6 +47,8 @@ ephemeral: bool = false,
auto_save: bool = false,
meta: ?[]const u8 = null,
lsp_version: usize = 1,
vcs_id: ?[]const u8 = null,
vcs_content: ?[]const u8 = null,
undo_head: ?*UndoNode = null,
redo_head: ?*UndoNode = null,
@ -1191,6 +1193,8 @@ pub fn create(allocator: Allocator) error{OutOfMemory}!*Self {
}
pub fn deinit(self: *Self) void {
if (self.vcs_content) |buf| self.external_allocator.free(buf);
if (self.vcs_id) |buf| self.external_allocator.free(buf);
if (self.meta) |buf| self.external_allocator.free(buf);
if (self.file_buf) |buf| self.external_allocator.free(buf);
if (self.leaves_buf) |buf| self.external_allocator.free(buf);