Formatting variable definition
Hi,
Here is a statement:
String s = "aa...aa";
If the value is long enough to exceed the line length, the autoformatting turns it into:
String
s =
"aa...aa";
I would expect
String s =
"aa...aa";
Is there a setting in IntelliJ to make the formatting work the way I want?
Thanks!
Alex
请先登录再写评论。
Hello.
Is it Java? It works as requested for me.
Can you attach your code style scheme? If you use Default or Project scheme, you can make a copy in Settings / Code Style / Manage. The file is by default saved in (user.home)/.IntelliJIdeaNN/config/codeStyles/ directory.
Regards,
Alexander.
Hi,
Yes, it is Java.
IntelliJ 13.1.4
The style file is attached. But I did try with 'default' and 'project' settings as well. Same result.
Thanks,
Alex
Attachment(s):
BAMSAS.XML
Thank you, reproduced.
I've found that the problem goes away, if in Settings / ... / Code Style / Wrapping and Braces / Assignment Statement change "Chop down if long" to "Wrap if long" or "Do not wrap". Please try, is that Ok to you.
Regards,
Alexander.
Wrap if long works as expected!
Thanks!
Do not wrap does not change anything, even in cases when
String a =
"long ... string";
would work just fine.
Thanks!