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 71545 - Basic Option "Expand tabs to Spaces" does not work as expected
Summary: Basic Option "Expand tabs to Spaces" does not work as expected
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Options (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker with 3 votes (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
: 71665 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-01-18 12:22 UTC by cylab
Modified: 2013-06-11 19:04 UTC (History)
1 user (show)

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 cylab 2006-01-18 12:22:16 UTC
Entering a value for "Number of spaces per Indent" in the "Basic Options", that
is less than the "Tab size" setting of the different Editors in the "Advanced
Options" leads to an unexpected behaviour where pressing the tab key produces an
indentation with spaces instead of hard tabs.

This seems to be caused by the "Basic Options" panel implementation to just
copying the values entered for indentation to the indentation engines only. 

The solution should be to copy the "Number of spaces per Indent" setting also to
the different Editors configuration in the "Advanced Options".
Comment 1 Max Sauer 2006-01-20 15:43:24 UTC
I cannot reproduce this inside 5.0rc2 (200601172200). Could you please tell us
which build are you using and/or provide more exact steps to reproduce?

> This seems to be caused by the "Basic Options" panel implementation to just
> copying the values entered for indentation to the indentation engines only. 
> The solution should be to copy the "Number of spaces per Indent" setting also to
> the different Editors configuration in the "Advanced Options".

I don't get it. The indentation settings made inside 'Basic' mode should affect
all the "Indentation engines" inside 'Advanced', which works as expected. And
since it is covered there, there is no need to have this option inside "Editor
settings".
Comment 2 cylab 2006-01-20 16:10:09 UTC
It is reproducable in all Netbeans 5 versions including RC2. The problem is,
that this does not necessarely specify as a BUG, since the separation of
indentation and tab size was intended (but imho useless) behaviour in prior
netbeans versions.

The problem is however, that the tab-size setting is not exposed in the basic
option panel, so the users (including me and _all_ my collegues;) ) are
confused, if spaces for intendation appear as long as the indentation is not
divisible by the tab size without remainder.

Try the following:
- go to "Advanced Options"
- switch to "Java Editor" under "Editing/Editor-Settings"
- set 8 for tab-size (and press enter to ;) damn jtable)
- switch to "Basic Options"
- set 2 for indent
- uncheck "Expand Tabs to Spaces"

Now try tabs or code reformat in an java editor. As long as the indent is not
divisible by 8, spaces appear regardless of keypress or code format.

This might be correct from the implementation perspective, but it is incorrect
from the users perspective (I've heard quite a few users complain).

There are two options to resolve this:
1) explain the difference between tab-size and indentation to the user and
expose the tab-size setting in the basic options

2) just copy the indent-setting to the tab-size setting off all editors, so the
above circumstances can never occour.

I hope this explanation is clearer.
Comment 3 Max Sauer 2006-01-20 16:20:35 UTC
Got it. As you have well described, this behaviour is 'as-designed', however
user unfriendly and confusing it is. I think the best solution would be to merge
tab size with "Number of spaces per Indent".

I'll change this to P1 ENHANCEMENT.
Comment 4 Max Sauer 2006-01-27 14:42:47 UTC
*** Issue 71665 has been marked as a duplicate of this issue. ***