diff options
Diffstat (limited to 'src/ghostty')
| -rw-r--r-- | src/ghostty/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ghostty/mod.rs b/src/ghostty/mod.rs index 3800ab49..8a909b8c 100644 --- a/src/ghostty/mod.rs +++ b/src/ghostty/mod.rs @@ -353,6 +353,7 @@ pub struct CellStyle { pub invisible: bool, pub strikethrough: bool, pub overline: bool, + pub underline: u8, pub underlined: bool, } @@ -370,11 +371,19 @@ impl From<ffi::GhosttyStyle> for CellStyle { invisible: value.invisible, strikethrough: value.strikethrough, overline: value.overline, + underline: normalize_underline_style(value.underline), underlined: value.underline != 0, } } } +fn normalize_underline_style(value: std::os::raw::c_int) -> u8 { + match value { + 0..=5 => value as u8, + _ => 1, + } +} + fn cell_color_from_style_color(color: ffi::GhosttyStyleColor) -> Option<CellColor> { match color.tag { ffi::GhosttyStyleColorTag_GHOSTTY_STYLE_COLOR_PALETTE => { |
