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

4 comments
Comment actions Permalink

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.

0
Comment actions Permalink

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
0
Comment actions Permalink

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.

0
Comment actions Permalink

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!

0

Please sign in to leave a comment.