diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-20 19:47:58 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-20 19:48:21 -0700 |
| commit | 385beb4998615d03568f64040bef9761f5cdcbf2 (patch) | |
| tree | 7e401ff29fcbb871c69cad7cc87113409e7127de /nomsu_compiler.lua | |
| parent | 878fff6db510d5ce15d5f274e1fe9eecc2b7799f (diff) | |
Slightly better newline handling for long text. Now won't force an
indent for "\nhello"
Diffstat (limited to 'nomsu_compiler.lua')
| -rw-r--r-- | nomsu_compiler.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/nomsu_compiler.lua b/nomsu_compiler.lua index 2b68bd9..b51605b 100644 --- a/nomsu_compiler.lua +++ b/nomsu_compiler.lua @@ -1001,9 +1001,13 @@ do break end if tree.type == "Text" then - if (function() + local check_for_nl + check_for_nl = function(tree) local found_nl = false for i, b in ipairs(tree) do + if type(b) ~= 'string' and b.type == "Text" and check_for_nl(b) then + return true + end if i == 1 and type(b) == 'string' then b = b:match('^[\n]*(.*)') end @@ -1012,7 +1016,8 @@ do return true end end - end)() then + end + if check_for_nl(tree) then break end end |
