From 0188cd49fe3b5797382bedb2fea767171090ad1f Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 4 Oct 2021 11:30:24 +0200 Subject: Cosmetics --- src/field.nim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/field.nim') diff --git a/src/field.nim b/src/field.nim index e7280f8..8d609f7 100644 --- a/src/field.nim +++ b/src/field.nim @@ -12,13 +12,13 @@ func Blank*(f: var Field, x, y: int) = if y < f.y or y >= f.y+f.ly: # outside the field return var l = addr f.lines[y-f.y] - if x < l.x or x >= l.x+l.l: # outside the field + if x < l.x or x >= l.x+l.l: # outside the field return - if x > l.x and x < l.x+l.l-1: # just set the value + if x > l.x and x < l.x+l.l-1: # just set the value l.columns[x-l.x] = int(' ') return if l.l == 1: # this was the last character on the line - if y == f.y: # we need to trim the leading lines + if y == f.y: # we need to trim the leading lines var i = 1 while f.lines[i].l == 0: inc i @@ -34,14 +34,14 @@ func Blank*(f: var Field, x, y: int) = else: # it was a line in the middle l.l = 0 l.columns = @[] - elif x == l.x: # we need to remove leading spaces + elif x == l.x: # we need to remove leading spaces var i = 1 while l.columns[i] == int(' '): inc i l.x += i l.columns = l.columns[i..= f.y: - if y < f.y+f.ly: # the line exists + if y < f.y+f.ly: # the line exists var l = addr f.lines[y-f.y] - if l.l == 0: # An empty line is a special case + if l.l == 0: # An empty line is a special case l.x = x l.l = 1 l.columns = @[v] -- cgit v1.2.3