aboutsummaryrefslogtreecommitdiff
path: root/utils.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2017-09-14 19:45:36 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2017-09-14 19:45:36 -0700
commit13490a34c872f5cde6b2f094d9dda045dec066d4 (patch)
tree45891326f4067518359af245cf63a6681f50c033 /utils.moon
parented0b5a3373add330b60b1850b8212eba681b031d (diff)
Made repr fix more flexible/correct.
Diffstat (limited to 'utils.moon')
-rw-r--r--utils.moon4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils.moon b/utils.moon
index 069b1a0..eb222fb 100644
--- a/utils.moon
+++ b/utils.moon
@@ -22,9 +22,9 @@ utils = {
elseif not x\find[[']] and not x\find"\n"
"\'"..x.."\'"
else
- for i=1,math.huge
+ for i=0,math.huge
eq = ("=")\rep(i)
- if not x\find"%[#{eq}%[" and not x\find"%]#{eq}%]"
+ if not x\find"%]#{eq}%]" and not x\match(".*]#{eq}$")
-- Stupid bullshit add an extra newline because lua discards first one if it exists
if x\sub(1,1) == "\n"
return "[#{eq}[\n"..x.."]#{eq}]"