This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245117 - [Formatting] multiline alignment of and/or conditions
Summary: [Formatting] multiline alignment of and/or conditions
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-18 07:39 UTC by terje7601
Modified: 2014-06-18 07:39 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description terje7601 2014-06-18 07:39:42 UTC
Currently there is already an option "multiline alignment for binary operators", but I would like an extra option for alignment of and/or conditions (or no extra option & just treat it as described below).

Specifically, I want the following piece of code, which is currently formatted as:

boolean test() {
    if((3 == 6)
       && (4 == 7)) {
        // do something
    }
		
    return (2 == 3)
           && (3 == 5);
}

to be instead formatted as:

boolean test() {
    if((3 == 6)
    && (4 == 7)) {
        // ...
    }
		
    return (2 == 3)
        && (3 == 5);
}

So for the if statement: align && and || with the "if" and align the conditions.
For the return statement: align && and || with the end of "return" (with a tab size of 4, this equals exactly 1 tab) and align the conditions.

Personally I think the proposed formatting is much more readable.