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 52053 - Indentation: expand tabs to spaces
Summary: Indentation: expand tabs to spaces
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-03 16:06 UTC by Darknight7
Modified: 2016-07-07 07:28 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darknight7 2004-12-03 16:06:55 UTC
This flag does not have the meaning/behaviour me
(and other colleagues) would expect.

Expected behaviour: if checked it should change
all tabs in a fixed number of spaces, if unchecked
all the code should be indented with "hard" tabs.

Now if I uncheck the flag I get spaces mixed with
tabs which is a severe hindrance when you switch
IDE (we run a hybrid environment with netbeans and
eclipse) as different people use different tab
sizes (typically 2-4-8).

Because of this we already use the eclipse
formatter for all sources except those that are
auto generated by the form editor, our swing
sources are by far less readable as people already
gave up on having them look nice and won't car
much about it.
Comment 1 stas 2005-01-10 10:59:02 UTC
IMHO the option should be ranamed. It should say "New Tabs" rather
than "Tabs".

Your idea that the whole file should be reformatted is a very bad one.
I don't want anyone to try to change just one line and end up f***ing
up the whole repository file just because they had their indentation
settings wrong.
Comment 2 Darknight7 2005-01-10 15:19:32 UTC
As far as I know the whole file IS already reformatted with current
behaviuor. The fact that you already have most tabs converted to
spaces is why you may have missed this.
I am making a proposal exactly for this reason, those who use tabs
should be able to use them well, just as those who use spaces. I guess
netbeans devs enjoy spaces, well, I don't. :)
Comment 3 swpalmer 2007-09-27 19:24:46 UTC
When this option is *unchecked*, pressing tab still inserts spaces instead of a hard tab.  It seems that you can't type
a tab and get a tab regardless of the setting.
Comment 4 Jiri Prox 2007-10-02 08:27:38 UTC
Please note that tab only jumps to the next indentation level. If you have default settings - tabsize=8 and indentation
level=4, you must press tab twice to insert single tab char.
Comment 5 ermass 2008-08-28 11:51:50 UTC
Thanks to jiriprox, now it is fine with me.
I used to have "Number of spaces to intend" = 4
and "Tab size" was 8. The "Expand Tab to spaces" was unchecked, but anyway when I pressed Tab, I get 4 spaces.
But reducing "Tab size" to 4 solved the problem. Now I have "hard" tab as expected.
Comment 6 synchro 2009-03-27 12:25:37 UTC
This made worse by the fact that there is no option to show invisible characters, so if you have some code that has been badly formatted with a mix of spaces 
and tabs, there's no way you can tell by looking at it. BBEdit has a nice solution to this - it shows spaces as a midline dot (UTF-8 C2B7), tabs as a small 
triangle and line breaks as a not sign (C2AC). These are displayed in a light grey, so they really don't interfere with coding. IMHO, using spaces for indents 
borders on criminal anyway!
Comment 7 Martin Balin 2016-07-07 07:28:07 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss