diff options
author | bptato <nincsnevem662@gmail.com> | 2023-10-26 22:10:17 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-10-26 22:10:17 +0200 |
commit | 8b8b8084a3e599faf69fb33230bad07844378dc6 (patch) | |
tree | b0281ed095be9f9b2ad46634d94fd539e95fd7a2 /src/types | |
parent | 77fe3c3e150c619f2f4623b0bb612a19ed682f9a (diff) | |
download | chawan-8b8b8084a3e599faf69fb33230bad07844378dc6.tar.gz |
renderdocument: slightly refactor, optimize addLines
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/cell.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/types/cell.nim b/src/types/cell.nim index ff5eafdd..19a566cc 100644 --- a/src/types/cell.nim +++ b/src/types/cell.nim @@ -143,6 +143,9 @@ func findNextFormat*(line: SimpleFlexibleLine, pos: int): SimpleFormatCell = proc addLine*(grid: var FlexibleGrid) = grid.add(FlexibleLine()) +proc addLines*(grid: var FlexibleGrid, n: int) = + grid.setLen(grid.len + n) + proc insertFormat*(line: var FlexibleLine, pos, i: int, format: Format, node: StyledNode = nil) = line.formats.insert(FormatCell(format: format, node: node, pos: pos), i) |