aboutsummaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-01-23 14:08:36 +0100
committerbptato <nincsnevem662@gmail.com>2024-01-23 14:08:36 +0100
commit2ff8f87f82cf971160eeced2ded6189d19e72162 (patch)
treef6ebd7d126b0e4c929f364e8c6c3686656c4f946 /src/render
parent9e0a2ace1f297a93c5214228a376bd4ad67086f4 (diff)
downloadchawan-2ff8f87f82cf971160eeced2ded6189d19e72162.tar.gz
Remove newFormat
Pointless; it just returned a default zero-initialized object.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/renderdocument.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/render/renderdocument.nim b/src/render/renderdocument.nim
index 264489e4..f86f276a 100644
--- a/src/render/renderdocument.nim
+++ b/src/render/renderdocument.nim
@@ -85,7 +85,7 @@ proc setText(grid: var FlexibleGrid, linestr: string, x, y: int,
if padwidth > 0:
# Replace formats for padding
- var padformat = newFormat()
+ var padformat = Format()
if fi == -1:
# No formats
inc fi # insert after first format (meaning fi = 0)
@@ -124,7 +124,7 @@ proc setText(grid: var FlexibleGrid, linestr: string, x, y: int,
# No formats => just insert a new format at 0
inc fi
grid[y].insertFormat(x, fi, format, node)
- lformat = newFormat()
+ lformat = Format()
else:
# First format's pos may be == x here.
lformat = grid[y].formats[fi].format # save for later use
@@ -240,12 +240,12 @@ proc paintBackground(grid: var FlexibleGrid, color: CellColor, startx,
# Process formatting around startx
if grid[y].formats.len == 0:
# No formats
- grid[y].addFormat(startx, newFormat())
+ grid[y].addFormat(startx, Format())
else:
let fi = grid[y].findFormatN(startx) - 1
if fi == -1:
# No format <= startx
- grid[y].insertFormat(startx, 0, newFormat())
+ grid[y].insertFormat(startx, 0, Format())
elif grid[y].formats[fi].pos == startx:
# Last format equals startx => next comes after, nothing to be done
discard