Monday, June 23, 2008

Enable whitespace for diff in NetBeans

I was working on a project and changed some files. NetBeans showed me several files had been modified compared to the latest versions from the versioning control system. But when I wanted to see the differences using the diff viewer in NetBeans I saw no changes. I turned out the only change had been in whitespace and by default NetBeans doesn't show the whitespace differences. The following figure doesn't show any change, but the change is there:

We can disable this so we can see all the changes to a file, even whitespace differences. We need to go to Tools | Options | Miscellaneous | DIff. Now we can uncheck the checkbox Ignore Whitespaces:

The diff viewer will now show the extra spaces added to line 12:

2 comments:

Varun said...

Hi,

My name is Varun Nischal and I'm the NetBeans Community Docs Contribution Coordinator. Your blog entry would make a fantastic tips and tricks for our Community Docs wiki (http://wiki.netbeans.org/CommunityDocs).

Would you be willing to contribute it? If you need any help or have any questions, please contact me at nvarun@netbeans.org

I look forward to hearing from you.

Thanks,
Varun Nischal
http://nb-community-docs.blogspot.com/
--
"You must do the things you think you cannot do."

mrhaki said...

Hi,

it is at http://wiki.netbeans.org/EnableWhitespaceForDiff.