Reputation: 15929
I prefer formatting assignments like this:
$foo = $bar;
$long_foo = $bar;
instead of this:
$foo = $bar;
$long_foo = $bar;
However the latter is being used by Netbeans when using auto format. Anyone knows how to fix that?
Upvotes: 6
Views: 2565
Reputation: 947
It's been 3 years since this question has been posted but I think it is very useful, so I should answer this question. I've found one website that it seems right to your question.
In Alignment category there are new properties for Group Multiline Alignment - Assignment and Array Initializer.
Upvotes: 5
Reputation: 2150
I think the short answer is: you can't. There are a few things you can configure as listed onhttp://netbeans.org/kb/docs/java/editor-codereference.html but for the most part there is not a lot of configuration.
Have you looked at 3rd party plugins? I used one for eclipse called Jalopy http://jalopy.sourceforge.net/ that I read somewhere might be supported for netbeans... Worth investigation
Upvotes: 0
Reputation: 11691
Generally, I'd like to know how to prevent Netbeans (and maybe other editors) from reformatting specific parts of my code... for example, Netbeans does a pretty bad job at formatting chained method calls with nesting. It totally ignores the nesting level when calculating the indentation width.
Upvotes: 1