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.
In the cnd Makefile editor I've overridden Formatter.expandTabs() so it always returns false. When I open a Makefile with a new userdir and press the Tab key it initially works as expected. However, if I open Tools->Options and go to the Editor node and press the Indentation tab (without changing anything), this changes. If I go back to the same Makefile and enter a Tab, it now is replaced by 4 spaces (even though my expandTabs() still returns false. This is because Formatter.java's static String getIndentString(int, boolean, int) is passed an initial indent of 4 (rather than the 8 I've set in my MakefileFormatter class). I do have a workaround (override the public getIndentString()) but its still a bit of a kludge and should be fixed in the trunk. There is also potential that other overagressive settings could cause further Makefile problems.
This does (still) have a direct affect on cnd and Makefiles. If I type 2 tabs, they get expanded to "\t\t" (as expected). If I open the Tools->Options and visit the Editor Indentation panel, then typing 2 tabs gets "\t " (1 tab followed by 4 spaces).
The Options->Editor->Indentation panel is an oversimplification. We should restore the state where the settings can be specific for individual languages into 6.0.
Please read issue #66187. Having Formatter.expandTabs() == false does *not* mean that you will ever only get \t in your document. The three settings expandTabs, tabSize and spacesPerTab work together in rather complex way that is described in #66187. IMO, what you want for makefile documents is: expandTabs == false and spacesPerTab always copy the value of tabSize. The tabSize setting is set through BaseOptions while the other two are on FormatterIndentEngine. You should override their getters to enforce the above rule. See also: issue #66187, issue #71936 *** This issue has been marked as a duplicate of 66187 ***