Open remorse opened 6 years ago
You can either disable the ResizeSpaces pass but you will lose some of its functionalities.
Otherwise you should probably consider adding your own pass that will extends the ResizeSpaces but differently manage spaces around those tokens "T_ELSE" and "T_ELSEIF".
To do so you will have to first extract the "fmt.phar" file to have access to the "fmt.stub.php" file which contains the source code and then rebuild the PHAR.
You can find an example in many forks of this repository to learn how to do so. You might want to look at this file : https://github.com/MKCG/phpfmt_7-1/blob/master/fix-fmt.php
@remorse did you tried this in your config?:
{
...
"smart_linebreak_after_curly": true,
...
}
Hi! I don't have a config file -- I'm using this as a text filter in BBEdit, so I have to pass everything from the command line. I did try adding --smart_linebreak_after_curly
to the command line, but that didn't seem to have any impact. I've also tried adding the SplitCurlyCloseAndTokens
pass, but that also didn't seem to affect anything. I haven't had a chance to try @MKCG's suggestion.
Hi! I like to write code with
else
(andelseif
) keywords starting their own line:Is there a way to make fmt.phar stop forcing the
else
s to be cuddled?Thanks, Ricky