about summary refs log tree commit diff stats
path: root/src/io/cell.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2021-11-13 01:16:50 +0100
committerbptato <nincsnevem662@gmail.com>2021-11-13 01:16:50 +0100
commit2e408503f452f0cac8ca2a63eaf59e0bfb332f1d (patch)
tree8e97bea10fe55e5336e913713094de7593d3caaa /src/io/cell.nim
parent5ed6ccd8e2422c28734842488896f5cbb012916c (diff)
downloadchawan-2e408503f452f0cac8ca2a63eaf59e0bfb332f1d.tar.gz
Optimized generateFullOutput
Diffstat (limited to 'src/io/cell.nim')
-rw-r--r--src/io/cell.nim8
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)