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 Tools -> Options -> Editor -> Indention I have defined: Number of spaces per indent: 2 Tab size: 2 Expand tabs to spaces (unchecked) The JSP editor still displays files with a tab size of 8, even after reformatting the first indent is done with a single tab that is expanded to 8 characters. Using 6.1 final, JDK 1.6, Windows XP I started with a clean userdir to make sure this was not caused by upgrading settings from RC2
Similar problems for me editing shell scripts, with exact same settings as reporter (tkellerer), basically: tab size=2, no expansion to spaces. Some more notes: 1. My files are Bourne shell scripts 2. The file names have no extension, e.g. "install" 3. When opening the file, they may display tab size of 8. They remain real tabs (not spaces) 4. If I press my tab key, it is inserted as a real tab, and displayed as size 8 5. If I then select all lines, then press SHIFT-TAB until all lines are left-justified, then press tab at the beginning of a line... now two space characters are inserted! The above illustrates at least two different bugs. <rant>Netbeans indenting has been buggy for years... drives me crazy. Can I help?</rant>
I noticed that when I try to reformat a wrongly displayed jsp page, I get an exception (tried to upload the exception report, but the portal seems to be down). Here is the stacktrace: java.lang.ArrayIndexOutOfBoundsException: 72 at org.netbeans.modules.editor.indent.api.IndentUtils.cachedOrCreatedIndentString(IndentUtils.java:228) at org.netbeans.modules.editor.indent.api.IndentUtils.createIndentString(IndentUtils.java:195) at org.netbeans.modules.editor.indent.spi.Context.modifyIndent(Context.java:177) at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.reformat(TagBasedLexerFormatter.java:358) at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.reformat(TagBasedLexerFormatter.java:160) at org.netbeans.modules.editor.structure.formatting.TagBasedLexerFormatter.process(TagBasedLexerFormatter.java:155) at org.netbeans.modules.web.core.syntax.indent.JspIndentTask.reindent(JspIndentTask.java:52) at org.netbeans.modules.editor.indent.TaskHandler$MimeItem.runTask(TaskHandler.java:502) at org.netbeans.modules.editor.indent.TaskHandler.runTasks(TaskHandler.java:271) at org.netbeans.modules.editor.indent.IndentImpl.reformat(IndentImpl.java:293) at org.netbeans.modules.editor.indent.FormatterImpl.reformat(FormatterImpl.java:161) at org.netbeans.editor.ActionFactory$FormatAction.actionPerformed(ActionFactory.java:1561) at org.netbeans.editor.BaseAction.actionPerformed(BaseAction.java:290) at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1636) at javax.swing.JComponent.processKeyBinding(JComponent.java:2849) at javax.swing.JComponent.processKeyBindings(JComponent.java:2884) at javax.swing.JComponent.processKeyEvent(JComponent.java:2812) at java.awt.Component.processEvent(Component.java:5876) at java.awt.Container.processEvent(Container.java:2058) at java.awt.Component.dispatchEventImpl(Component.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Component.dispatchEvent(Component.java:4296) at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1848) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:704) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:969) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:841) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:668) at java.awt.Component.dispatchEventImpl(Component.java:4338) at java.awt.Container.dispatchEventImpl(Container.java:2116) at java.awt.Window.dispatchEventImpl(Window.java:2458) at java.awt.Component.dispatchEvent(Component.java:4296) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104) [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:284) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
I think I fixed the exception, see http://hg.netbeans.org/main/rev/979ca7bbfe0a. As for the problem with settings I'm not sure why this is broken for JSP, but for any language based on Schliemann or GSF settings don't work well. There are defects filed for those frameworks, but they all pretty much depend on issue #90403 (deprecation of BaseOptions), which I'm currently working on.
Well, I went back to 6.0 for developing my web applications...
Integrated into 'main-golden', available in NB_Trunk_Production #177 build Changeset: http://hg.netbeans.org/main/rev/979ca7bbfe0a User: Vita Stejskal <vstejskal@netbeans.org> Log: #134217: preventing AIOOBE; the array length must be one larger than the max index
This is also a problem for standard Java editing. I can't seem to get NetBeans to use anything but tabs at 8 spaces. In addition, expanding tabs to spaces doesn't seem to be working correctly either. I'm going back to NetBeans 6.0 for now. This is a show stopper for me.
*** Issue 135300 has been marked as a duplicate of this issue. ***
*** Issue 136234 has been marked as a duplicate of this issue. ***
I checked that on .java and .jsp files and it is working fine in a trunk build. I think it was fixed by the recent changes done for #90403.
*** Issue 132772 has been marked as a duplicate of this issue. ***
verified Product Version: NetBeans IDE Dev (Build 200811050201) Java: 1.6.0_10; Java HotSpot(TM) Client VM 11.0-b15 System: Linux version 2.6.27-7-generic running on i386; UTF-8; en_US (nb)