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.
When using code templates with indented blocks (e. g. fnc tab or if tab), tabs are replaced by one space. This happens only if options/editor/formatting/expand tabs to spaces is not checked. Example: fnc + tab Expected result: function functionName($param) { [tab] } Actual result: function functionName($param) { [space] } If I use code template (e.g. if) in parent block (e.g. fnc), parent block is badly reformated too. Please fix it before NB 6.9 final if possible.
(In reply to comment #0) > When using code templates with indented blocks (e. g. fnc tab or if tab), tabs > are replaced by one space. This happens only if > options/editor/formatting/expand tabs to spaces is not checked. i do have spaces (in length of tab) instead of tab if 'expand tab to spaces' is enabled or not. I am not really sure this is a bug, it looks like intention. Petr?
I have the same problem. I have made a detailed description with screen shots here: http://forums.netbeans.org/viewtopic.php?t=28951 "expand tabs to spaces" is not enabled in my setup.
*** Bug 188135 has been marked as a duplicate of this bug. ***
Hi I have the same issues on Netbeans 6.9 Mac OSX I also have it on my PC in 6.9 or 6.10 Could you please look into it as the templates are one of the main reasons for using Netbeans. Downgraded to 6.8 on my PC where the templates still work. Thanks Sean
> 10 votes means P2
The last comment is from 09/2010 and I have fixed some issues with spaces and tabs in code templates last year. I can not reproduce anymore in development build. Marking as fixed, please reopen if you find a case where it doesn't work.
Still not working.
In which build it doesn't work for you?
Product Version: NetBeans IDE 6.9.1 (Build 201011082200) Java: 1.6.0_20; Java HotSpot(TM) Client VM 16.3-b01 System: Windows XP version 5.1 running on x86; Cp1250; pl_PL (nb)
It's fixed in NetBeans 7.0 code. I can not reproduce there. If you can reproduce in a NB 7.0 build, please reopen.
In 7.0 there will be no Ruby on Rails support, so 7.0 is not an option for me (I use NB for PHP, RoR and Java). Could you please fix this in 6.9.1 ?
I'm afraid that there is no plan for another patch for NB 6.9.
I need to mark it as fixed, because the Target Milestone was 7.0 and there is already fixed.
I'm using PHP in NetBeans 7.0 (Build 201104080000); only PHP is currently activated. When 'Expand Tabs to Spaces' is unchecked in Tools->Options->Editor->Formatting, tabs are still expanded to spaces. The default value is '4', and there are 4 spaces. If I select 'PHP' under the Language drop-down, 'Override Global Options' is unchecked, so it should not be overriding anything. The only time the option correctly works is when "Number of Spaces per Indent" is set to '8', in that case, a [Tab] is correctly inserted (and is the length of eight spaces). I have this same build installed on another machine that has both Java and PHP enabled and this issue does not occur, so it may be limited to only PHP. Please fix!
This is misunderstanding. The option "Number of Spaces per Indent" is really saying how many space should be used for one indentation level. But also there is option "Tab Size", which is how many spaces represent the tabulator size. By default the Tab Size property is set to 8 doe to some historic reasons. See issue #153609 or #144067. So if you want to use tabulator character for indentation level, you should set as well the Tab Size property to 4.
Petr, that's not what I meant - regardless of what the 'Tab Size' is (it is set at 4 at the moment, and setting it to 8 or 6 or 5 or whatever doesn't make a difference). The issue is that when 'Expand Tabs to Spaces' is unchecked, which should mean that a [Tab] inserts a [Tab] and not "spaces", it still inserts "spaces". Only when the 'Number of Spaces per Indent' is set to 8 does it properly insert a [Tab] - but at all other settings it inserts "spaces". After enabling Java in the IDE the issue no longer exists; therefore I suggest to test it on a fresh install and only enabling PHP.
So if I understand correctly, you have unchecked "Expand Tabs to Spaces" and "Number of Spaces per Indent" set up to 4 and "Tab Size" to 4. And with this setting NB still use spaces not '\t', i'm right? I can not reproduce this and I use only the php build. Could you attach an example file?
I have played it again. I have unchecked Expand to Spaces, Number Of Spaces per Indent was 4, Tab size 8. Both Java editor and PHP editor behaves in the same way: When I press Tab key at the begin of the line, the 4 spaces are added. When I pres Tab for the second time another for spaces are added, but the 8 spaces are converted to the /t char. I'm closing this issue as fixed, until we will not clarify what is wrong. I'm sorry I probably just missed something, but for me it looks ok. Please clarify your settings and behavior. Strange to me sounds that it's different for PHP and Java editor.