From 6fa1cb23d151463b7d85dcf9d5c413420d11ecad Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 9 Nov 2018 17:43:06 -0800 Subject: Fixed decompile issue with short actions not getting indented. --- nomsu_decompiler.moon | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nomsu_decompiler.moon') diff --git a/nomsu_decompiler.moon b/nomsu_decompiler.moon index f44b628..0bc4805 100644 --- a/nomsu_decompiler.moon +++ b/nomsu_decompiler.moon @@ -217,7 +217,10 @@ tree_to_nomsu = (tree)-> bit_nomsu\parenthesize! if next_space == " " and not bit_nomsu\is_multiline! and nomsu\trailing_line_len! + #bit_nomsu\text! > MAX_LINE - next_space = " \\\n.." + if bit.type == 'Action' + bit_nomsu = NomsuCode\from bit.source, "(..)\n ", tree_to_nomsu(bit) + else + next_space = " \\\n.." unless next_space == " " and bit.type == "Block" nomsu\append next_space @@ -230,7 +233,7 @@ tree_to_nomsu = (tree)-> nomsu = recurse(tree[1]) if tree[1].type == 'Block' and not nomsu\is_multiline! nomsu\parenthesize! - return NomsuCode tree.source, "\\", nomsu + return NomsuCode\from tree.source, "\\", nomsu when "Block" for i, line in ipairs tree -- cgit v1.2.3