From 2e408503f452f0cac8ca2a63eaf59e0bfb332f1d Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 13 Nov 2021 01:16:50 +0100 Subject: Optimized generateFullOutput --- src/io/cell.nim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/io/cell.nim') 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) -- cgit 1.4.1-2-gfad0