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 271320

Summary: Netbeans adding characters to file
Product: php Reporter: antoniocs <antoniocs>
Component: Formatting & IndentationAssignee: issues@php <issues>
Status: NEW ---    
Severity: normal    
Priority: P1    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: I have added an enter to file
Git diff display

Description antoniocs 2017-08-17 16:00:07 UTC
Created attachment 164970 [details]
I have added an enter to file

I am not exactly sure what is happening with netbeans, but I have this php file with 3000+ lines of code, if I change ONE line (even if it's just an enter) and then I save a file when I do a git diff file.php I see loads of invisible characters being added.

To note that if I try to edit the file in notepad++ I have no issues. Only the line I have changed in the editor shows up when I do a git diff.

I have attached a picture showing how I added an enter to file. You can see on the right side you only see ONE green marker.

The next image shows you the git diff on the command line. You will see lines like:

-  
+  
   
Completely empty, and I have these ALL OVER the file. 
This is preventing me from committing my work as I have only changed 3 lines in the file but the git diff is showing hundreds
Comment 1 antoniocs 2017-08-17 16:02:00 UTC
Created attachment 164971 [details]
Git diff display
Comment 2 Dusan Balek 2017-08-18 15:09:48 UTC
Don't you have any Save Action (like remove trailing whitespace, or reformat) enabled for your mime-type? Could you please check Options -> Editor -> On Save? Thanks.
Comment 3 antoniocs 2017-08-18 21:10:16 UTC
I had the PHP settings set to use the "All Languages" settings and that is set to None on "Reformat" and "Remote Trailing Whitespace From"

On the PHP language I had to uncheck "Use All Language Settings" and set "Reformat" and "Remote Trailing Whitespace From" to "Modified Lines Only"

Does "None" have a different meaning in this context? I assumed "None" meant that nothing would be done, but that doesn't seem to be the case.
Comment 4 Dusan Balek 2017-08-21 07:20:01 UTC
Reassigning to PHP for evaluation.