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-15 21:03:19 +0100
committerbptato <nincsnevem662@gmail.com>2021-11-15 21:03:19 +0100
commitd3d9139dd6aa535ed1d7f2c78accd6ac5fa89b3e (patch)
tree3f21c217de6f8d616d6d455c5f7da2511bff0664 /src/io/cell.nim
parent9b95435ae6a859f5da69d2fc473099df5102e243 (diff)
downloadchawan-d3d9139dd6aa535ed1d7f2c78accd6ac5fa89b3e.tar.gz
Abstract away FlexibleCell, fix pageUp/pageDown
Diffstat (limited to 'src/io/cell.nim')
-rw-r--r--src/io/cell.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/io/cell.nim b/src/io/cell.nim
index d757c2de..e1b2aef4 100644
--- a/src/io/cell.nim
+++ b/src/io/cell.nim
@@ -46,6 +46,21 @@ func width*(cell: FixedCell): int =
 func newFormatting*(): Formatting =
   return Formatting(fgcolor: defaultColor, bgcolor: defaultColor)
 
+proc addLine*(grid: var FlexibleGrid) =
+  grid.add(newSeq[FlexibleCell]())
+
+proc addCell*(grid: var FlexibleGrid, y: int, r: Rune) =
+  grid[y].add(FlexibleCell(rune: r))
+
+proc addCell*(grid: var FlexibleGrid, y: int, r: Rune, format: Formatting) =
+  grid[y].add(FlexibleCell(rune: r, formatting: format))
+
+proc addCell*(grid: var FlexibleGrid, y: int, r: Rune, format: Formatting, nodes: seq[Node]) =
+  grid[y].add(FlexibleCell(rune: r, formatting: format, nodes: nodes))
+
+proc addCell*(grid: var FlexibleGrid, r: Rune, format: Formatting) =
+  grid[^1].add(FlexibleCell(rune: r, formatting: format))
+
 proc setText*(grid: var FlexibleGrid, x: int, y: int, text: seq[Rune]) =
   while grid.len <= y:
     grid.add(newSeq[FlexibleCell]())
othj5@gmail.com> 2016-10-06 00:20:20 +0100 committer James Booth <boothj5@gmail.com> 2016-10-06 00:20:20 +0100 Minor code tidy cmd_ac.h' href='/danisanti/profani-tty/commit/src/command/cmd_ac.h?id=82a8f5f10b41a765d7acf63bd805f099b1f93b9a'>82a8f5f1 ^
eaf2901b ^







1926ceea ^
eaf2901b ^

eaf2901b ^


dcc2123e ^

dfe61341 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62