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-14 12:57:50 +0100
committerbptato <nincsnevem662@gmail.com>2021-11-14 13:00:34 +0100
commit60b583516262be8754c6563ed9253b8964bef5d8 (patch)
treed77fabc0eb4b8ce4432b45a1845999c9a0698e40 /src/io/cell.nim
parenta6099512e42cc95cf6276ab784afd70febdd43b7 (diff)
downloadchawan-60b583516262be8754c6563ed9253b8964bef5d8.tar.gz
Initial implementation of CSS :hover
Diffstat (limited to 'src/io/cell.nim')
-rw-r--r--src/io/cell.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/io/cell.nim b/src/io/cell.nim
index 67b7361c..d757c2de 100644
--- a/src/io/cell.nim
+++ b/src/io/cell.nim
@@ -5,6 +5,7 @@ import sugar
 
 import types/color
 import utils/twtstr
+import html/dom
 
 type
   Formatting* = object
@@ -18,6 +19,7 @@ type
 
   Cell* = object of RootObj
     formatting*: Formatting
+    nodes*: seq[Node]
 
   FlexibleCell* = object of Cell
     rune*: Rune
@@ -38,6 +40,9 @@ func width*(line: FlexibleLine): int =
   for c in line:
     result += c.rune.width()
 
+func width*(cell: FixedCell): int =
+  return cell.runes.width()
+
 func newFormatting*(): Formatting =
   return Formatting(fgcolor: defaultColor, bgcolor: defaultColor)