EnableWhitespaceForDiff

Enable whitespace for diff in NetBeans

by Hubert A. Klein Ikkink; first published in blog

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:

Image:netbeans-diff1_EnableWhitespaceForDiff.png

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":

Image:netbeans-diff2_EnableWhitespaceForDiff.png

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

Image:netbeans-diff3_EnableWhitespaceForDiff.png
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo