Minor formatting fix for calculator.

Don't output a newline before a list constant if in calculator mode. While we're there, make a comparison more compact.
This commit is contained in:
Sei Lisa 2017-01-12 01:57:40 +01:00
parent e5ffe56fec
commit a961fee1c3

View file

@ -151,14 +151,11 @@ class outscript(object):
ret += ']' ret += ']'
self.listmode = False self.listmode = False
return ret return ret
ret = '\n' ret = '' if lslcommon.IsCalc else '\n'
first = True first = True
self.indentlevel += 1 self.indentlevel += 1
for entry in value: for entry in value:
if not first: ret += self.dent() + ('[ ' if first else ', ')
ret += self.dent() + ', '
else:
ret += self.dent() + '[ '
self.listmode = True self.listmode = True
ret += self.Value2LSL(entry) + '\n' ret += self.Value2LSL(entry) + '\n'
self.listmode = False self.listmode = False