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 225781 - Reformat on save does not fix invalid indentation
Summary: Reformat on save does not fix invalid indentation
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-06 08:45 UTC by Jiri Prox
Modified: 2016-07-07 07:26 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 Jiri Prox 2013-02-06 08:45:20 UTC
Reformat on save does not fix invalid indentation in following case:

1) turn on Reformat modified lines on save
2) have a code:
    public static void main(String[] args) {
        MyList<String> c = new MyList<String>();
        c.add("aaaa");
        System.out.println("");
    }

3) put caret on the begging of the text on line 'c.add'
4) press backspace several times
5) save the file
-> the line is not move to correct indentation level and stays as it is
(does not matter if you move cursor to another line before saving)

Interesting is that if the line is moved to invalid position by space the reformat works fine


Product Version: NetBeans IDE 7.3 RC2 (Build 201302050851)
Java: 1.7.0_13; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_13-b20
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\AppData\Roaming\NetBeans\7.3rc2
Cache directory: C:\Users\jprox\AppData\Local\NetBeans\Cache\7.3rc2
Comment 1 Dusan Balek 2013-04-24 13:53:59 UTC
The problem seems to be that REMOVE document events don't mark given lines as modified (only INSERT document events do so).
Comment 2 Martin Balin 2016-07-07 07:26:04 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