AndrewWhitaker/sql-formatter — pull request #1 by ruffin-- (2014-08-01 16:26:14+00:00)
Title: Fixes no newline before nested ReservedTopLevel tokens.

Line 232 was `Trim`ming too much. See original:
https://github.com/jdorn/sql-formatter/blob/master/lib/SqlFormatter.php#L634

`$return = rtrim($return,$tab).str_repeat($tab, $indent_level);`

Only need to trim tab characters from the end of `result` that `SqlFormatter` had already inserted.
This was `TrimEnd`ing away any and all whitespace, including newline from previous addition.