refactor: lots more writergate fixes - first successful build

This commit is contained in:
CJ van den Berg 2025-09-25 22:01:29 +02:00
parent 5094aa8c85
commit bf0d4402ea
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
48 changed files with 404 additions and 413 deletions

View file

@ -11,13 +11,13 @@ pub const create = Type.create;
pub fn load_entries(self: *Type) !void {
const editor = tui.get_active_editor() orelse return;
try self.file_path.appendSlice(editor.file_path orelse "");
try self.file_path.appendSlice(self.allocator, editor.file_path orelse "");
if (editor.get_primary().selection) |sel| ret: {
const text = editor.get_selection(sel, self.allocator) catch break :ret;
defer self.allocator.free(text);
if (!(text.len > 2 and std.mem.eql(u8, text[0..2], "..")))
self.file_path.clearRetainingCapacity();
try self.file_path.appendSlice(text);
try self.file_path.appendSlice(self.allocator, text);
}
}