mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
config: FontStyle.clone
This commit is contained in:
@ -3248,6 +3248,14 @@ pub const FontStyle = union(enum) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Deep copy of the struct. Required by Config.
|
||||||
|
pub fn clone(self: Self, alloc: Allocator) !Self {
|
||||||
|
return switch (self) {
|
||||||
|
.default, .false => self,
|
||||||
|
.name => |v| .{ .name = try alloc.dupeZ(u8, v) },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/// Used by Formatter
|
/// Used by Formatter
|
||||||
pub fn formatEntry(self: Self, formatter: anytype) !void {
|
pub fn formatEntry(self: Self, formatter: anytype) !void {
|
||||||
switch (self) {
|
switch (self) {
|
||||||
|
Reference in New Issue
Block a user