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 58668

Summary: Allow marking of parts of file that are not formatted after format (Ctrl+Shift+F) command
Product: editor Reporter: _ sandipchitale <sandipchitale>
Component: Formatting & IndentationAssignee: Dusan Balek <dbalek>
Status: RESOLVED WONTFIX    
Severity: blocker    
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description _ sandipchitale 2005-05-08 02:02:34 UTC
This is along the lines of <pre></pre> tag of html. This is because sometimes 
I layout the gridbag layout constraints in a tabular from for easy reading. I 
can supply an example if required.

A fold with a special tag/attribute could be used for this.
Comment 1 Jiri Prox 2006-06-06 10:03:49 UTC
I'm afraid I don't understand it very well, can you provide some examples.
Comment 2 _ sandipchitale 2006-06-06 14:17:44 UTC
Here is an example:

Sometimes I have long lines of code (array initilization) which need to stay 
on same line for tabular view i.e. not wrap. To make maximum use of the 
visible part editor I do not want to indent those lines and I want to start 
them in the left margin like so:

public class Census {

    public long calculateAveragePopulation() {
//<--- left margin. code intentionally at the left margin
String[] states     = { "Alabama", "Arizona", "Alaska", ... 50 state names };
long[] populations  = { 237456293, 13762782,  4567820,  ... 50 populations };

    }
}

Now if I invoke the reformat command the two lines will get indented like this

public class Census {

    public long calculateAveragePopulation() {

        String[] states     = { "Alabama", "Arizona", "Alaska", ... 50 state 
names };
        long[] populations  = { 237456293, 13762782,  4567820,  ... 50 
populations };

    }
}
Granted this is a contrieved example. The point is that some times there is 
some intrinsic meaning that is conveyed by the layout of the code and I want 
to preserve it even if I reformat rest of code using "Format Code" action.

Makes sense?
Comment 3 Martin Balin 2016-07-07 07:28:44 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss