mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Changed behaviour of bold-color (#7871)
Continuation of discussion in https://github.com/ghostty-org/ghostty/discussions/3134 This changes the behaviour of the new bold-color option to only affect the default foreground text when set to a static colour. By using a static colour, the remaining colours are rendered as bright.
This commit is contained in:
@ -2893,8 +2893,8 @@ else
|
|||||||
/// This can be set to a specific color, using the same format as
|
/// This can be set to a specific color, using the same format as
|
||||||
/// `background` or `foreground` (e.g. `#RRGGBB` but other formats
|
/// `background` or `foreground` (e.g. `#RRGGBB` but other formats
|
||||||
/// are also supported; see the aforementioned documentation). If a
|
/// are also supported; see the aforementioned documentation). If a
|
||||||
/// specific color is set, this color will always be used for all
|
/// specific color is set, this color will always be used for the default
|
||||||
/// bold text regardless of the terminal's color scheme.
|
/// bold text color. It will set the rest of the bold colors to `bright`.
|
||||||
///
|
///
|
||||||
/// This can also be set to `bright`, which uses the bright color palette
|
/// This can also be set to `bright`, which uses the bright color palette
|
||||||
/// for bold text. For example, if the text is red, then the bold will
|
/// for bold text. For example, if the text is red, then the bold will
|
||||||
|
@ -154,15 +154,12 @@ pub const Style = struct {
|
|||||||
|
|
||||||
.palette => |idx| palette: {
|
.palette => |idx| palette: {
|
||||||
if (self.flags.bold) {
|
if (self.flags.bold) {
|
||||||
if (opts.bold) |bold| switch (bold) {
|
if (opts.bold) |_| {
|
||||||
.color => |v| break :palette v.toTerminalRGB(),
|
|
||||||
.bright => {
|
|
||||||
const bright_offset = @intFromEnum(color.Name.bright_black);
|
const bright_offset = @intFromEnum(color.Name.bright_black);
|
||||||
if (idx < bright_offset) {
|
if (idx < bright_offset) {
|
||||||
break :palette opts.palette[idx + bright_offset];
|
break :palette opts.palette[idx + bright_offset];
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break :palette opts.palette[idx];
|
break :palette opts.palette[idx];
|
||||||
|
Reference in New Issue
Block a user