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 222074 - Reformat on save splits lines
Summary: Reformat on save splits lines
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-13 21:57 UTC by _ gtzabari
Modified: 2012-11-24 13:05 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2012-11-13 21:57:31 UTC
Product Version: NetBeans IDE Dev (Build 201211060001)
Java: 1.7.0_09; Java HotSpot(TM) 64-Bit Server VM 23.5-b02
Runtime: Java(TM) SE Runtime Environment 1.7.0_09-b05
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

1. Configure Editor -> On Save as follows:

All languages:
Reformat: Modified lines only
Remove trailing whitespace from: modified lines only

2. The project formatting settings are to wrap long lines (in all cases)
3. Given this line of text which has been modified:

getCompanies = server.companies().type(CompaniesEntities.JSON_TYPE_V1).get(CompaniesEntities.G|etCompanies.class);

4. Where | denotes the caret (see "G|et" near the end of the line).
5. Hit save
6. This results in two lines:

getCompanies = server.companies().type(CompaniesEntities.JSON_TYPE_V1).get(Co
	mpaniesEntities.GetCompanies.class);

7. If I select the line and hit ALT+SHIFT+F the resulting code-format is correct:

getCompanies = server.companies().type(CompaniesEntities.JSON_TYPE_V1).
	get(CompaniesEntities.GetCompanies.class);

I set priority to P2 because this could result in a large number of compile-time errors depending on the number of lines the user edits before hitting save.
Comment 1 Dusan Balek 2012-11-23 08:51:41 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/dacf0e6356f3
Comment 2 Quality Engineering 2012-11-24 13:05:26 UTC
Integrated into 'main-golden', will be available in build *201211240959* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/dacf0e6356f3
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #222074: Reformat on save splits lines - fixed.