diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-28 16:19:42 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-28 16:19:42 +0300 |
| commit | 80c0c07250d22f69d3fa05cb1700302d66180eb8 (patch) | |
| tree | 9e1903d65c83263354be4b2166f3a7c92dc2a8e2 /crates | |
| parent | 8c8cb49c237eec2f82192dd831ec7308905f2c0a (diff) | |
perf: send scrolling pane output as row shifts and skip blank cells (#4711)
* perf: send scrolling pane output as row shifts and skip blank cells
* fix: keep expanded scroll patches disjoint for the fast presentation path
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/ghostty-vt/src/lib.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/ghostty-vt/src/lib.rs b/crates/ghostty-vt/src/lib.rs index 056ff142..7ee1e751 100644 --- a/crates/ghostty-vt/src/lib.rs +++ b/crates/ghostty-vt/src/lib.rs @@ -3381,6 +3381,17 @@ impl<'a> RowCellIter<'a> { unsafe { ffi::ghostty_render_state_row_cells_select(self.cells.raw, x).into_result() } } + /// Whether the current cell was never written: no text, default style, + /// narrow, and no hyperlink. One read replaces the style and text lookups + /// for the blank cells that fill most wide panes. + pub fn is_default_blank(&self) -> Result<bool, Error> { + // Packed cell bits 0..44 hold content, style id, and width; bit 45 is + // the hyperlink flag. Protection (44) and OSC 133 semantic marks + // (46..48) do not change how a cell renders. + const PRESENTATION_BITS: u64 = ((1 << 44) - 1) | (1 << 45); + Ok(self.raw_cell()? & PRESENTATION_BITS == 0) + } + fn raw_cell(&self) -> Result<ffi::GhosttyCell, Error> { let mut raw = ffi::GhosttyCell::default(); unsafe { |
