diff options
Diffstat (limited to 'src/render')
| -rw-r--r-- | src/render/renderdocument.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/render/renderdocument.nim b/src/render/renderdocument.nim index 484f8fb5..4fddddc7 100644 --- a/src/render/renderdocument.nim +++ b/src/render/renderdocument.nim @@ -261,6 +261,15 @@ proc renderInlineContext(grid: var FlexibleGrid, ctx: InlineContext, x, y: int, let spacing = InlineSpacing(atom) grid.setSpacing(spacing, x, y, term) +proc renderTable(grid: var FlexibleGrid, ctx: TableBox, x, y: int, term: TermAttributes) = + for row in ctx.nested: + assert row.computed{"display"} == DISPLAY_TABLE_ROW + for cell in row.nested: + let x = x + row.offset.x + let y = y + row.offset.y + assert cell.computed{"display"} == DISPLAY_TABLE_CELL + grid.renderBlockContext(cell, x, y, term) + proc renderBlockContext(grid: var FlexibleGrid, ctx: BlockBox, x, y: int, term: TermAttributes) = var stack = newSeqOfCap[(BlockBox, int, int)](100) stack.add((ctx, x, y)) @@ -281,6 +290,8 @@ proc renderBlockContext(grid: var FlexibleGrid, ctx: BlockBox, x, y: int, term: if ctx.inline != nil: assert ctx.nested.len == 0 grid.renderInlineContext(ctx.inline, x, y, term) + elif ctx.computed{"display"} == DISPLAY_TABLE: #TODO INLINE_TABLE + grid.renderTable(TableBox(ctx), x, y, term) else: for i in countdown(ctx.nested.high, 0): stack.add((ctx.nested[i], x, y)) |