vtcode_ghostty_core/
cell.rs1use crate::style::Style;
2
3#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub struct Cell {
6 pub(crate) ch: char,
7 pub(crate) style: Style,
8 pub(crate) wide_continuation: bool,
9}
10
11impl Cell {
12 pub(crate) fn blank(style: Style) -> Self {
14 Self {
15 ch: ' ',
16 style,
17 wide_continuation: false,
18 }
19 }
20
21 pub(crate) fn printable(ch: char, style: Style) -> Self {
23 Self {
24 ch,
25 style,
26 wide_continuation: false,
27 }
28 }
29
30 pub(crate) fn wide_continuation(style: Style) -> Self {
32 Self {
33 ch: ' ',
34 style,
35 wide_continuation: true,
36 }
37 }
38
39 pub fn ch(&self) -> char {
41 self.ch
42 }
43
44 pub fn style(&self) -> &Style {
46 &self.style
47 }
48
49 pub fn is_wide_continuation(&self) -> bool {
51 self.wide_continuation
52 }
53
54 pub fn is_blank(&self) -> bool {
56 self.ch == ' ' && !self.wide_continuation
57 }
58}