feat(buffers): move buffer lifetime management to new Buffer.Manager module

This commit is contained in:
CJ van den Berg 2025-01-21 21:42:36 +01:00
parent fbeaefe7ff
commit aa1e0674cc
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
6 changed files with 109 additions and 48 deletions

View file

@ -11,7 +11,6 @@ pub const create = Type.create;
pub fn load_entries(self: *Type) error{ Exit, OutOfMemory }!void {
const editor = tui.get_active_editor() orelse return;
if (editor.is_dirty()) return tp.exit("unsaved changes");
if (editor.file_path) |old_path|
if (std.mem.lastIndexOf(u8, old_path, "/")) |pos|
try self.file_path.appendSlice(old_path[0 .. pos + 1]);