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.
Created attachment 94375 [details] Screenshot of the editor after a few lines of code have been inserted and the file saved. In some circumstances, the IDE's integrated source editor removes whitespace on blank lines before saving the file. What happens: In any case this bug arises, the whitespace characters (spaces and tabs) on some blank lines (lines consisting of nothing but spaces and tabs) are removed and after that, the file is saved. This happens at least in the following cases: * After a blank line has been inserted using the return key and the cursor has been moved to a different line before saving. * After multiple lines of code containing blank lines have been inserted. * Whitespace has been added to a blank line and the cursor has been moved to a different line before saving. This bug has been discussed by other members on the NetbBeans Forums without a resolution: http://forums.netbeans.org/ptopic16161.html I've attached a screenshot with whitespace highlighted in puke orange, showing how properly indented source code gets mangled after pasting.
Currently (as requested by users) the editor removes trailing whitespace. The exact algorithm is to remove whitespace on modified lines except of the line with the caret. This is not what all users want and there is another issue #157561 requesting to make this customizable. *** This bug has been marked as a duplicate of bug 157561 ***