From 66e7bedccc3c6d9b40e0be8217fb491b0ab27444 Mon Sep 17 00:00:00 2001 From: Agent Ottsel Date: Wed, 28 Nov 2018 14:50:03 -0200 Subject: [PATCH] Fix indentation of functions that receive tables Credits to Arpple for providing the code that fixed this issue: https://github.com/trixnz/lua-fmt/issues/35#issuecomment-430600174 --- src/printer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/printer.ts b/src/printer.ts index b8bff50..7669c95 100644 --- a/src/printer.ts +++ b/src/printer.ts @@ -244,7 +244,8 @@ function printNodeNoParens(path: FastPath, options: Options, print: PrintFn) { const canBreakLine = node.init.some(n => n != null && n.type !== 'TableConstructorExpression' && - n.type !== 'FunctionDeclaration' + n.type !== 'FunctionDeclaration' && + n.type !== 'CallExpression' ); return group(