diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-30 15:55:13 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-30 15:55:13 +0300 |
| commit | b7015f17a49501e99642009ebadabcbefc0fbad0 (patch) | |
| tree | d245bcac1ef14e2272e3850d698fcccae1f8c379 /src/ghostty | |
| parent | e9bcea9c0da2ebd996b4b570c504582740f3466e (diff) | |
fix: render ansi undercurl styles
refs #895
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 => { |
