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 C++ source window, the indentations within "if" "else" block are all mess up, e.g. if (...) { statements; } else { statements; } became : if (...) { statements; } else { statements; }
Created attachment 69002 [details] screenshot show problem of this IZ
Please, provide c/c++ formatting settings and NB version
I got nb6.5 from Thomas' download for ceres SSIDE, and here is the version info that I got from IDE help, I guess it is 20080902 build. Product Version: Sun Studio (Build 200809021401, Sun Studio 20080610) Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-b03 System: SunOS version 5.10 running on x86; ISO646-US; en (sunstudio) Userdir: /net/benjamin2/export/ws/jeanko/dinstall/ideuserdir
As for c/c++ format settings, I did not do anything with it, everything is defaul.
I need an steps to reproduce bug. And, please, attach right screen shot, because attachment does not contain picture.
To reproduce, edit a file with cat and put tabs into it. It looks like the default tab expansion has switched from 8 to 4 between NB6.1 and NB6.5 In nb65 go to Tools->Options->Editor->Formatting. I see TabSize is set to 4. It should be set to 8. This lookslike a change in NB because if you choose AllLanguages TabSize is also 4. And if you go to NB 6.1 that same TabSize used to is 8. This probably should be reassigned to nb editor.
Created attachment 69479 [details] jif file that show this problem
fixed, change set: http://hg.netbeans.org/main/rev/945196efd334
Integrated into 'main-golden', will be available in build *200809101401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/945196efd334 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed IZ#146116:code formattter regress for if statement
Created attachment 70362 [details] image file shows problem still exist
Probem seems still exist : Product Version: Sun Studio (Build 20080917154240, Sun Studio 20080918) Java: 1.5.0_07; Java HotSpot(TM) Client VM 1.5.0_07-b03 System: SunOS version 5.10 running on x86; ISO646-US; en (sunstudio) Userdir: /home/jeanko/.nide65/intel-S2
Please, - attach problem file. - describe steps to reproduce bug. Because I have only guess about tab size. I.e file was created in other ¨tab size¨. In this case it is not bug.
fix initial tab size: - use tab size = 8 for c/c++ files instead NB default tab size = 4 Before checking bug, please, clear user dir. Change set: http://hg.netbeans.org/main/rev/2f6df693e450
Integrated into 'main-golden', will be available in build *200809241401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/2f6df693e450 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixed IZ#146116:code formattter regress for if statement - use own tab size as default
I'm a bit concerned about this deviation from the NB default. NB chose to go from 8 to 4 for some reason. We should really try and find why NB did that. There is nothing about C/C++ specifically that mandates a tab size of one kind or another.
Created attachment 70515 [details] file withtabs in it
I just added an attachment. It is a file created with vi with tabstop=8 and shiftwidth=4. (shiftwidth == indent) If you use ":set list" in vi this is what you will see: $ #include <stdio.h>$ $ main(int argc, char *argv[])$ {$ for (int cx = 0; cx < argc; cx++) {$ ^Iif (argv[cx][0] == '-') {$ ^I printf("Saw option '%s'\n", argv[cx]);$ ^I} else {$ ^I printf("Saw argument '%s'\n", argv[cx]);$ ^I}$ }$ }$ $ denotes end-of-line. The ^I are tabs. Note how vi will "collapse" 2 indents into one tab. I then blew away my userdir and FileOpen'ed it under NB. NB settings are as follows: IndentSize 4 Expand Tabs to Spaces yes Tab Size 8 With these settings the file is presented incorretly with the if/print/else/print lines appearing aligned the same as the for line. I found out that if I disable "Expand Tabs to Spaces" that things work correctly. So it seems that something in "Expand Tabs to Spaces" doesn't work right ... I also found out that this is very sensitive to ordering of things ... setting the options, vs opening a file, whether the Document underlying the open file is cached etc.
It is exactly what I fixed Wed Sep 24 10:47:02 +0000 2008