Have Format leave spacing alone?

Answered

I found the place where I can have the Code Style for my code to have or not have spaces around (say) the equals sign, but I can't find out where I can set it to ignore whatever spacing is currently there.

If I have:

a = 5;

and I unclick the code style that requires the surrounding spaces, then no matter what, if I reformat (or say invoke a live template to surround a section with braces with reformatting selected), then even if I *wanted* the surrounding space in that particular case it will remove it.

Is there a "leave it as is" section in the settings for reformatting?  I would have sworn I saw it before.

 
0
4 comments

You either have spaces or have no spaces, there is no other option:

0

Yeah, apparently it's the Editor-->Code Style-->Java-->Wrapping and Braces-->Keep when reformatting that I was thinking of.  But obviously, that doesn't work for spaces.

Each formatting choice in spaces should really be a trinary state: yes/no/ignore for each space item so that I can still have formatting, but only for certain things.  Spaces around logical operators, but ignore what I have written for assignment, etc.

When I figure out how to enter a feature request, I'll do it.

Thanks.

 
0

Done, and thanks.

If anyone's interested, the request to have code styles be trinary in nature (yes/no/ignore) is here: IDEA-186504.

 
0

Please sign in to leave a comment.