refactor: fix completion updates

This commit is contained in:
CJ van den Berg 2026-01-30 13:22:47 +01:00
parent b314a4c8c0
commit d4eb0d046c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 9 additions and 4 deletions

View file

@ -137,6 +137,7 @@ fn update_query(self: *Type, cursor: ed.Cursor) error{OutOfMemory}!void {
else => |e_| return e_,
};
defer self.allocator.free(query);
self.update_query(query) catch return;
tp.self_pid().send(.{ "cmd", "completion" }) catch |e| self.logger.err(module_name, e);
return;
}

View file

@ -267,6 +267,7 @@ pub fn Create(options: type) type {
}
pub fn update_query(self: *Self, query: []const u8) !void {
self.query.clearRetainingCapacity();
try self.query.appendSlice(self.allocator, query);
return self.start_query(0);
}