Skip to content
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

How I can setup indentation for empty lines? #1664

Open
DanDolog opened this issue Apr 1, 2024 · 2 comments
Open

How I can setup indentation for empty lines? #1664

DanDolog opened this issue Apr 1, 2024 · 2 comments

Comments

@DanDolog
Copy link

DanDolog commented Apr 1, 2024

Hello! I've encountered a problem. I can’t find information anywhere on how to configure the formatting of empty lines. Do I understand correctly that now in SwiftFormat you can either clear all spaces in empty lines or not format them at all?

I have these settings--indent tab, --tabwidth 4,--trimwhitespace nonblank-lines and SwiftFormat simply ignores this nightmare:
Screenshot 2024-04-01 at 16 23 41

Expected result (Ctrl+I in Xcode):
Screenshot 2024-04-01 at 16 32 30

What do you think and what can you advise in this case? Thanx!

@nicklockwood
Copy link
Owner

I think this isn't supported at the moment - as you say the options are either to truncate blank lines or leave them alone. I'll consider this a feature request.

@DanDolog
Copy link
Author

DanDolog commented Apr 1, 2024

Thank you very much, I'll be waiting!
I think this is a relatively popular problem since many people have spaces and tabs highlighted. And also adding spaces on empty lines is the default behavior of Xcode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants