This is because the absolute indentation of the code block are preserved, instead of the relative indentation between the lines of the code blocks. In other words, when we move a code block to align with a surrounding, we want to move all lines of the block, not just the first.
Consider that we want to format the following query, with a max line length of 85 (the high max line length is required until https://github.com/OyvindSabo/gremlint/issues/65 is fixed):
It should be formatted to
but instead it is formatted to
This is because the absolute indentation of the code block are preserved, instead of the relative indentation between the lines of the code blocks. In other words, when we move a code block to align with a surrounding, we want to move all lines of the block, not just the first.