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.

Bug 118362

Summary: Indentation: Tab Size and Spaces per Indent
Product: groovy Reporter: noxis <noxis>
Component: EditorAssignee: Martin Janicek <mjanicek>
Status: RESOLVED WORKSFORME    
Severity: blocker CC: dbalek
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 90403    
Bug Blocks:    

Description noxis 2007-10-10 13:59:51 UTC
Daily Build: 200710081200

I am using tabs for my sources. Expand Tabs to Spaces is unchecked.
When I set Tab Size to 4 and Spaces per Indent to 4, everything works fine. After NetBeans restart, code looks like with
Tab Size = 8, but in Options I still see Tab Size = 4. To fix this, I have to change Tab Size to 8, accept settings,
change Tab Size to 4 and then code looks ok... until next restart...
Comment 1 Vitezslav Stejskal 2007-10-10 15:17:58 UTC
This seems to work fine in my build. What file types are you using? Is it java?
Comment 2 noxis 2007-10-10 16:53:38 UTC
Yes. It's Java - maven project.

I have tried build 200710100000 and I can reproduce this bug all the time.
Comment 3 Jiri Prox 2007-10-11 08:24:53 UTC
Have you imported your old setting from previous NB version?
Comment 4 Vitezslav Stejskal 2007-10-11 10:02:08 UTC
If so, then this is a duplicate of issue #115997.
Comment 5 noxis 2007-10-11 12:23:25 UTC
It was a clean install with no config import. But with a different --userdir it started to work. I have compared user
dirs, and...
my original config/Editors/text/x-java/properties.xml doesn't have:

<property class="java.lang.Integer" name="tab-size" value="4"/>

It's not saved even when I change Tab Size in Options.

When I add it manually to that xml file, everything seems to work fine.
Comment 6 inonit 2007-12-05 18:39:46 UTC
I just wanted to confirm same scenario:

New install of 6.0 FCS, no user migration of settings, manually reconfigured tabs-spaces using same values as noxis,
close IDE, open IDE and tabs showed as 8 spaces in Java (but not JavaScript; did not try other languages).

If I changed them (I used the technique of checking, hitting OK, and then unchecking and hitting OK, for the expansion
of tabs to spaces), the file would still show wrong but if I moved the cursor through the file each line would change on
the fly to reflect the correct settings.

Performing the same workaround as noxis (editing XML file) worked for me also, as I also was missing that entry.
Comment 7 inonit 2007-12-05 18:45:24 UTC
I can also add that the same problem occurs with the "Right Margin" value.
Comment 8 Vitezslav Stejskal 2007-12-06 09:47:43 UTC
Dusane, any ideas or is this likely to be in the settings infra?
Comment 9 Jiri Prox 2008-04-11 00:42:47 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 10 michael 2008-05-16 10:55:01 UTC
Same problem here as noxis, but only for JSP files.
The manual reset in the options seems to be the only way to get the indents working.
It seems that the stored values are ignored completely on startup.
I know my preference of 2 spaces is not for all, but a default of 8 seems excessive (It should really be 4).
Comment 11 Vitezslav Stejskal 2008-06-24 19:25:10 UTC
Could you guys please retry this in a dev build. It seems to be working now after fixing #90403 and a few other things.
I checked specifically with .java and .jsp. There is also issue #134217, which describes the same problem for .jsp
files. Please reopen if you still find it broken.
Comment 12 Kevin_Sheedy 2010-05-29 09:00:45 UTC
Same issue as noxis described still present for .groovy files.
Am a new NetBeans user so it's clean install with no settings imported.

Product Version: NetBeans IDE 6.8 (Build 200912041610)
Java: 1.6.0_20; Java HotSpot(TM) Client VM 16.3-b01
System: Windows Vista version 6.0 running on x86; Cp1252; en_IE (nb)
Userdir: C:\Users\Kevin\.netbeans\6.8
Comment 13 Xedecimal 2011-12-08 01:07:29 UTC
I haven't noticed anyone mentioning anything about the CheckStyle plugin. Once I enabled this my tabs went wonky! Once I disabled it everything returned to normal.
Comment 14 Dusan Balek 2012-05-16 12:49:02 UTC
Is it still reproducible in groovy files?
Comment 15 Martin Janicek 2012-05-16 13:21:43 UTC
I've just tried to follow described steps on a Java SE project with a groovy files inside and it works just fine (--> the behavior is completely the same as for java files).