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 188135

Summary: Wrong snippets indentation when using tab for indent
Product: php Reporter: s.seletskiy
Component: Formatting & IndentationAssignee: Petr Pisl <ppisl>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description s.seletskiy 2010-06-28 04:19:25 UTC
Using tab for indentation cause wrong indentation calculations when inserting snippets, though when spaces are used for indentation all looks good.

Steps to reproduce:
1. create PHP file with contents:
<?php
$a = array(1,
<TAB>2);

2. create snippet with name "i" and with expanding by hitting "TAB":
if($a) {
<TAB>{$cursor}
}

3. type in newly created file, right after all contents in a new line: i<TAB>

Actual results:
<?php
$a = array(1,
<TAB>2);
   if($a) {
<TAB>
}

Expected results:
<?php
$a = array(1,
<TAB>2);
if($a) {
<TAB>
}

Product Version: NetBeans IDE 6.9 (Build 201006101454)

Additional information:
Same bug appears when I trying to insert snippet in context like this:
<?php
class A {
<TAB>public function b{
<TAB><TAB>//insert here
<TAB>}
}

Wrong indentation in some cases can be fixed by pressing alt+shift+f, such as second example, but can't be fixed in first.

When I check "Expand Tabs to Spaces" in "Formatting" tab indentation inserting correctly.
Comment 1 s.seletskiy 2010-07-28 06:26:27 UTC

*** This bug has been marked as a duplicate of bug 187127 ***