Issue
I'm currently using Netbeans 7.0.1 for PHP development on the Mac.
The tab formatting in some of the code I'm working with is incorrect (its tabbed/indented in too far).
When I try to correct this by using shift+tab (reverse indents code), the CPU usage for Netbeans will start to spike and can get over 300%. This is especially true if I try to shift+tab more then one line at a time. This can even cause Netbeans to permanently hang and requiring a force quit to close.
Even if I only shift+tab a single line at a time, the CPU usage will build up making Netbeans unusable. Can someone please explain what causes this and how to resolve it? If it cannot be resolved is there a workaround for reformatting large blocks of code?
Solution
I don't know what the issue here might be but I wanted to give you another way of formatting code. To format the entire document you can use the Alt+Shift+F key combination. To format only a block of code, select (highlight) the code you want to format and use the same key combination.
However, this technique will result in the format that you are not happy with. So, if the default indentation is not to your liking you can configure this through the Options panel: Tools > Options > Editor[Tab] > Formatting[Tab]. Set the language to PHP and set the Category to "Tabs and Indents". Then you can check the "Override Global Options" check box and set the Tab Size to whatever you need.
Answered By - Jonathan Spooner