diff --git a/common/formatter/formatter.cpp b/common/formatter/formatter.cpp index 7a55f56e13..11038a695b 100644 --- a/common/formatter/formatter.cpp +++ b/common/formatter/formatter.cpp @@ -312,7 +312,7 @@ std::vector apply_formatting(const FormatterTreeNode& curr_node, if (i == (int)curr_node.refs.size() - 1 && form_lines.size() > 1 && (curr_node.formatting_config.hang_forms || curr_node.formatting_config.combine_first_two_lines)) { - form_lines.at(0) += fmt::format(" {}", form_lines.at(1)); + form_lines.at(0) += fmt::format(" {}", str_util::ltrim(form_lines.at(1))); form_lines.erase(form_lines.begin() + 1); } else if ((i + 1) < (int)curr_node.refs.size()) { const auto& next_ref = curr_node.refs.at(i + 1); diff --git a/test/common/formatter/corpus/indent.test.gc b/test/common/formatter/corpus/indent.test.gc index c6d6c872f9..6354cd463d 100644 --- a/test/common/formatter/corpus/indent.test.gc +++ b/test/common/formatter/corpus/indent.test.gc @@ -150,39 +150,18 @@ Long array creation (the-as (function none) (-> arr i))))) === -!Nested function call +TODO - Nested function call === (set! (-> this attack-event) - (the-as symbol ((the-as - (function res-lump symbol symbol float structure (pointer res-tag) pointer object) - (method-of-type res-lump get-property-struct) - ) - (-> this entity) - 'attack-event - 'interp - -1000000000.0 - 'dark-eco-pool - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - ) - + (the-as symbol + ((the-as (function res-lump symbol symbol float structure (pointer res-tag) pointer object) (method-of-type res-lump get-property-struct)) + (-> this entity) + 'attack-event))) --- (set! (-> this attack-event) - (the-as symbol ((the-as - (function res-lump symbol symbol float structure (pointer res-tag) pointer object) - (method-of-type res-lump get-property-struct) - ) - (-> this entity) - 'attack-event - 'interp - -1000000000.0 - 'dark-eco-pool - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - ) \ No newline at end of file + (the-as symbol + ((the-as (function res-lump symbol symbol float structure (pointer res-tag) pointer object) (method-of-type res-lump get-property-struct)) + (-> this entity) + 'attack-event))) \ No newline at end of file