mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
small stylistic changes
This commit is contained in:
@ -36,8 +36,8 @@ pub const Kind = union(enum) {
|
|||||||
special: Special,
|
special: Special,
|
||||||
|
|
||||||
pub fn parse(key: []const u8) ?Kind {
|
pub fn parse(key: []const u8) ?Kind {
|
||||||
if (std.meta.stringToEnum(Special, key)) |s| return Kind{ .special = s };
|
if (std.meta.stringToEnum(Special, key)) |s| return .{ .special = s };
|
||||||
return Kind{ .palette = std.fmt.parseUnsigned(u8, key, 10) catch return null };
|
return .{ .palette = std.fmt.parseUnsigned(u8, key, 10) catch return null };
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn format(
|
pub fn format(
|
||||||
|
@ -1345,25 +1345,20 @@ pub const StreamHandler = struct {
|
|||||||
self.terminal.color_palette.colors[palette] = v.color;
|
self.terminal.color_palette.colors[palette] = v.color;
|
||||||
self.terminal.color_palette.mask.unset(palette);
|
self.terminal.color_palette.mask.unset(palette);
|
||||||
},
|
},
|
||||||
|
|
||||||
.special => |special| {
|
.special => |special| {
|
||||||
const msg: renderer.Message = switch (special) {
|
const msg: renderer.Message = switch (special) {
|
||||||
.foreground => msg: {
|
.foreground => msg: {
|
||||||
self.foreground_color = v.color;
|
self.foreground_color = v.color;
|
||||||
break :msg .{
|
break :msg .{ .foreground_color = v.color };
|
||||||
.foreground_color = v.color,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
.background => msg: {
|
.background => msg: {
|
||||||
self.background_color = v.color;
|
self.background_color = v.color;
|
||||||
break :msg .{
|
break :msg .{ .background_color = v.color };
|
||||||
.background_color = v.color,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
.cursor => msg: {
|
.cursor => msg: {
|
||||||
self.cursor_color = v.color;
|
self.cursor_color = v.color;
|
||||||
break :msg .{
|
break :msg .{ .cursor_color = v.color };
|
||||||
.cursor_color = v.color,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
else => {
|
else => {
|
||||||
log.warn(
|
log.warn(
|
||||||
@ -1385,25 +1380,20 @@ pub const StreamHandler = struct {
|
|||||||
self.terminal.color_palette.colors[palette] = self.terminal.default_palette[palette];
|
self.terminal.color_palette.colors[palette] = self.terminal.default_palette[palette];
|
||||||
self.terminal.color_palette.mask.unset(palette);
|
self.terminal.color_palette.mask.unset(palette);
|
||||||
},
|
},
|
||||||
|
|
||||||
.special => |special| {
|
.special => |special| {
|
||||||
const msg: renderer.Message = switch (special) {
|
const msg: renderer.Message = switch (special) {
|
||||||
.foreground => msg: {
|
.foreground => msg: {
|
||||||
self.foreground_color = self.default_foreground_color;
|
self.foreground_color = self.default_foreground_color;
|
||||||
break :msg .{
|
break :msg .{ .foreground_color = self.default_foreground_color };
|
||||||
.foreground_color = self.default_foreground_color,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
.background => msg: {
|
.background => msg: {
|
||||||
self.background_color = self.default_background_color;
|
self.background_color = self.default_background_color;
|
||||||
break :msg .{
|
break :msg .{ .background_color = self.default_background_color };
|
||||||
.background_color = self.default_background_color,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
.cursor => msg: {
|
.cursor => msg: {
|
||||||
self.cursor_color = self.default_cursor_color;
|
self.cursor_color = self.default_cursor_color;
|
||||||
break :msg .{
|
break :msg .{ .cursor_color = self.default_cursor_color };
|
||||||
.cursor_color = self.default_cursor_color,
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
else => {
|
else => {
|
||||||
log.warn(
|
log.warn(
|
||||||
|
Reference in New Issue
Block a user