terminal is fixed and im not happy about it

This commit is contained in:
Zacharias-Brohn
2026-04-09 23:49:32 +02:00
parent f38033c782
commit 5129612f9f
3 changed files with 59 additions and 19 deletions
+10 -9
View File
@@ -13,7 +13,7 @@ use crate::gpu_types::{
EdgeGlowUniforms, QuadParams, StatuslineParams,
ATLAS_SIZE, MAX_ATLAS_LAYERS, ATLAS_BPP, MAX_EDGE_GLOWS,
COLOR_TYPE_DEFAULT, COLOR_TYPE_INDEXED, COLOR_TYPE_RGB,
ATTR_BOLD, ATTR_ITALIC, ATTR_STRIKE,
ATTR_BOLD, ATTR_ITALIC, ATTR_STRIKE, ATTR_REVERSE,
COLORED_GLYPH_FLAG,
CURSOR_SPRITE_BEAM, CURSOR_SPRITE_UNDERLINE, CURSOR_SPRITE_HOLLOW,
DECORATION_SPRITE_STRIKETHROUGH, DECORATION_SPRITE_UNDERLINE, DECORATION_SPRITE_DOUBLE_UNDERLINE,
@@ -1718,11 +1718,12 @@ impl Renderer {
/// Pack cell attributes into u32 format for GPU.
/// underline_style: 0=none, 1=single, 2=double, 3=curly, 4=dotted, 5=dashed
#[inline]
fn pack_attrs(bold: bool, italic: bool, underline_style: u8, strikethrough: bool) -> u32 {
fn pack_attrs(bold: bool, italic: bool, underline_style: u8, strikethrough: bool, reverse: bool) -> u32 {
let mut attrs = (underline_style as u32) & 0x7; // 3 bits for decoration type
if bold { attrs |= ATTR_BOLD; }
if italic { attrs |= ATTR_ITALIC; }
if strikethrough { attrs |= ATTR_STRIKE; }
if reverse { attrs |= ATTR_REVERSE; }
attrs
}
@@ -1899,7 +1900,7 @@ impl Renderer {
bg: Self::pack_color(&cell.bg_color),
decoration_fg: 0,
sprite_idx: 0, // No glyph for continuation
attrs: Self::pack_attrs(cell.bold, cell.italic, cell.underline_style, cell.strikethrough),
attrs: Self::pack_attrs(cell.bold, cell.italic, cell.underline_style, cell.strikethrough, cell.reverse),
};
col += 1;
continue;
@@ -1972,7 +1973,7 @@ impl Renderer {
bg: Self::pack_color(&current_cell.bg_color),
decoration_fg: 0,
sprite_idx: final_sprite_idx,
attrs: Self::pack_attrs(cell.bold, cell.italic, cell.underline_style, cell.strikethrough),
attrs: Self::pack_attrs(cell.bold, cell.italic, cell.underline_style, cell.strikethrough, cell.reverse),
};
}
@@ -2023,7 +2024,7 @@ impl Renderer {
bg: Self::pack_color(&current_cell.bg_color),
decoration_fg: 0,
sprite_idx: sprite_idx | COLORED_GLYPH_FLAG,
attrs: Self::pack_attrs(cell.bold, cell.italic, cell.underline_style, cell.strikethrough),
attrs: Self::pack_attrs(cell.bold, cell.italic, cell.underline_style, cell.strikethrough, cell.reverse),
};
}
@@ -2052,7 +2053,7 @@ impl Renderer {
bg: Self::pack_color(&cell.bg_color),
decoration_fg: 0,
sprite_idx,
attrs: Self::pack_attrs(cell.bold, cell.italic, cell.underline_style, cell.strikethrough),
attrs: Self::pack_attrs(cell.bold, cell.italic, cell.underline_style, cell.strikethrough, cell.reverse),
};
col += 1;
}
@@ -2628,7 +2629,7 @@ impl Renderer {
let fg = Self::pack_statusline_color(*fg_color);
let bg = Self::pack_statusline_color(*bg_color);
let style = if *bold { FontStyle::Bold } else { FontStyle::Regular };
let attrs = Self::pack_attrs(*bold, false, 0, false);
let attrs = Self::pack_attrs(*bold, false, 0, false, false);
let (sprite_idx, is_colored) = if *c == ' ' || *c == '\0' {
(0, false)
@@ -2677,7 +2678,7 @@ impl Renderer {
let fg = Self::pack_statusline_color(fg_color);
let bg = Self::pack_statusline_color(bg_color);
let style = if bold { FontStyle::Bold } else { FontStyle::Regular };
let attrs = Self::pack_attrs(bold, false, 0, false);
let attrs = Self::pack_attrs(bold, false, 0, false, false);
let (sprite_idx, is_colored) = if c == ' ' || c == '\0' {
(0, false)
@@ -2715,7 +2716,7 @@ impl Renderer {
for component in section.components.iter() {
let component_fg = Self::pack_statusline_color(component.fg);
let style = if component.bold { FontStyle::Bold } else { FontStyle::Regular };
let attrs = Self::pack_attrs(component.bold, false, 0, false);
let attrs = Self::pack_attrs(component.bold, false, 0, false, false);
// Process characters with lookahead for multi-cell symbols
let chars: Vec<char> = component.text.chars().collect();