diff options
author | bptato <nincsnevem662@gmail.com> | 2021-11-13 01:16:50 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-11-13 01:16:50 +0100 |
commit | 2e408503f452f0cac8ca2a63eaf59e0bfb332f1d (patch) | |
tree | 8e97bea10fe55e5336e913713094de7593d3caaa /src/io/cell.nim | |
parent | 5ed6ccd8e2422c28734842488896f5cbb012916c (diff) | |
download | chawan-2e408503f452f0cac8ca2a63eaf59e0bfb332f1d.tar.gz |
Optimized generateFullOutput
Diffstat (limited to 'src/io/cell.nim')
-rw-r--r-- | src/io/cell.nim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/io/cell.nim b/src/io/cell.nim index 50094e88..983c5b4d 100644 --- a/src/io/cell.nim +++ b/src/io/cell.nim @@ -4,7 +4,7 @@ import types/color import utils/twtstr type - Cell* = object of RootObj + Formatting* = object fgcolor*: CellColor bgcolor*: CellColor italic*: bool @@ -13,6 +13,9 @@ type strike*: bool overline*: bool + Cell* = object of RootObj + formatting*: Formatting + FlexibleCell* = object of Cell rune*: Rune @@ -43,3 +46,6 @@ func newFixedGrid*(w: int, h: int = 1): FixedGrid = func width*(line: FlexibleLine): int = for c in line: result += c.rune.width() + +func newFormatting*(): Formatting = + return Formatting(fgcolor: defaultColor, bgcolor: defaultColor) |