New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to preserve indentation on empty lines #1322
Comments
Any chances? This behavior is very inconvenient. I don't know at all how you came up with not make it optional. |
@HanabishiRecca This is would involve adding the option, changing the if statement below, and writing tests. Probably a 4-8 hours of work, unfortunately I don't have time to work on this currently. Any help you can give would be great! |
@bitwiseman, but save != formatting. For example VS Code has auto-formatting on the fly.
Ok, I will try to look for it. |
@bitwiseman, check https://github.com/HanabishiRecca/js-beautify/commit/3effb435f480fe91fce4dd8cae011d8257475a5b |
@HanabishiRecca The build should work on Windows and Mac (it does in CI). What error are you seeing? |
@bitwiseman, started pull request.
Bash & make requires at least linux subsystem, isn't it? |
Finally I built it via WSL. Also found and fixed another bug. |
@HanabishiRecca I think option name and value needs to be modified. We're not preserving the whitespace that was on those lines, we're forcing it to the indent level. So, two ideas - which of these do you think is better:
Finally, we need some tests. I've added a few smoke tests to your PR take a look and try adding any others you can think of. |
1st variant with shorter name is good. |
This will be in the v1.9.1. |
@HanabishiRecca |
I'd like to request an option for preserving the indentation level on empty lines between indented code.
Use case: The preserved indentation on empty lines makes it easier to insert additional code between two existing lines without having to manually correct the indentation. I'm used to this from various editors and IDEs and I'm really missing this as an option in VSCode (which I was told uses JSBeautify as a formatter and thus cannot provide an option for it).
The text was updated successfully, but these errors were encountered: