mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-24 20:56:08 +03:00
config: RepeatableString.clone should clone all the strings too
This commit is contained in:
@ -2498,9 +2498,14 @@ pub const RepeatableString = struct {
|
||||
|
||||
/// Deep copy of the struct. Required by Config.
|
||||
pub fn clone(self: *const Self, alloc: Allocator) !Self {
|
||||
return .{
|
||||
.list = try self.list.clone(alloc),
|
||||
};
|
||||
// Copy the list and all the strings in the list.
|
||||
const list = try self.list.clone(alloc);
|
||||
for (list.items) |*item| {
|
||||
const copy = try alloc.dupeZ(u8, item.*);
|
||||
item.* = copy;
|
||||
}
|
||||
|
||||
return .{ .list = list };
|
||||
}
|
||||
|
||||
/// The number of itemsin the list
|
||||
|
Reference in New Issue
Block a user