Loading...

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: