How can I prevent IDEA from aligning values in Groovy when formatting?
Answered
I'm having an issue where IDEA is aligning certain values in my Groovy build.gradle and I haven't been able to find a setting to get it to stop. Here's how I want it to be formatted:
And here's what happens when the file saves (I have auto-format on save enabled) after manually formatting it as above:
How can I prevent this alignment from occurring when formatting? I haven't been able to find an appropriate setting by searching the web or the IDEA settings dialog.
I'm using IDEA 2021.2.3 Community Edition build #IC-212.5457.46 on Windows 10.
Please sign in to leave a comment.
Settings (Preferences on macOS) | Editor | Code Style | Groovy | Wrapping and Braces | List and map literals | Align when multiple
Settings (Preferences on macOS) | Editor | Code Style | Groovy | Wrapping and Braces | List and map literals | Align multiline named arguments
Settings (Preferences on macOS) | Editor | Code Style | Groovy | Wrapping and Braces | Assignment statement | Align when multiline
Settings (Preferences on macOS) | Editor | Code Style | Groovy | Wrapping and Braces | Group declarations | Align fields in columns
Settings (Preferences on macOS) | Editor | Code Style | Groovy | Wrapping and Braces | Array initializer | Align when multiline
Ah-ha! It was "List and map literals | Align multiline named arguments". I thought I'd toggled them all off, but I must have missed that one.
Thank you!