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 181013 - Whitespace mangling on blank lines
Summary: Whitespace mangling on blank lines
Status: RESOLVED DUPLICATE of bug 157561
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: All All
: P3 normal (vote)
Assignee: issues@editor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-21 16:19 UTC by Feuermurmel
Modified: 2010-02-22 03:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of the editor after a few lines of code have been inserted and the file saved. (36.81 KB, image/png)
2010-02-21 16:19 UTC, Feuermurmel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Feuermurmel 2010-02-21 16:19:42 UTC
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.
Comment 1 Vitezslav Stejskal 2010-02-22 03:20:55 UTC
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 ***