mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00

committed by
Jonathan Lopez

parent
3ba8d7f8fb
commit
4e0433f77f
@ -2843,17 +2843,21 @@ pub fn loadCliArgs(self: *Config, alloc_gpa: Allocator) !void {
|
|||||||
// replace the entire list with the new list.
|
// replace the entire list with the new list.
|
||||||
inline for (fields, 0..) |field, i| {
|
inline for (fields, 0..) |field, i| {
|
||||||
const v = &@field(self, field);
|
const v = &@field(self, field);
|
||||||
const len = v.list.items.len - counter[i];
|
|
||||||
if (len > 0) {
|
// The list can be empty if it was reset, i.e. --font-family=""
|
||||||
// Note: we don't have to worry about freeing the memory
|
if (v.list.items.len > 0) {
|
||||||
// that we overwrite or cut off here because its all in
|
const len = v.list.items.len - counter[i];
|
||||||
// an arena.
|
if (len > 0) {
|
||||||
v.list.replaceRangeAssumeCapacity(
|
// Note: we don't have to worry about freeing the memory
|
||||||
0,
|
// that we overwrite or cut off here because its all in
|
||||||
len,
|
// an arena.
|
||||||
v.list.items[counter[i]..],
|
v.list.replaceRangeAssumeCapacity(
|
||||||
);
|
0,
|
||||||
v.list.items.len = len;
|
len,
|
||||||
|
v.list.items[counter[i]..],
|
||||||
|
);
|
||||||
|
v.list.items.len = len;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user