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 189002 - Issue with indenting PHP files that use the alternate PHP format
Summary: Issue with indenting PHP files that use the alternate PHP format
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-28 04:36 UTC by JannieT
Modified: 2011-11-16 16:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description JannieT 2010-07-28 04:36:29 UTC
What I get when I press Alt+Shift+F:

<div>
    <?php foreach ($chapters as $chapter): ?>
        <div><?php echo $chapter['name']; ?></div>
    <?php endforeach; ?>
    </div>        
    
    <div>    
    <?php foreach ($chapters as $chapter): ?>
            <div><?php echo $chapter['name']; ?></div>
    <?php endforeach; ?>
</div>    

--------------------------------------

What I expected:

<div>
    <?php foreach ($chapters as $chapter): ?>
        <div><?php echo $chapter['name']; ?></div>
    <?php endforeach; ?>
</div>        

<div>    
    <?php foreach ($chapters as $chapter): ?>
        <div><?php echo $chapter['name']; ?></div>
    <?php endforeach; ?>
</div>


Additional info:
There also seems to be trailing blank spaces inserted after the closing </div> tags that is not expected.
Comment 1 Petr Pisl 2010-08-09 14:52:50 UTC
Both issues are reproducible. The spaces after </div> tag and the code is not formatted properly.
Comment 2 Petr Pisl 2010-08-09 16:13:52 UTC
I have fixed the problem with spaces. Still need to be handle the alternative php syntax in html files.
Comment 3 Quality Engineering 2010-08-10 03:11:01 UTC
Integrated into 'main-golden', will be available in build *201008100001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/c687416126e0
User: Petr Pisl <ppisl@netbeans.org>
Log: #189002 -  Issue with indenting PHP files that use the alternate PHP format

This doesn't fix directly the issue. It's fix of similar problem that has to be fixed before fixing issue #189002
Comment 4 Petr Pisl 2010-08-10 14:03:07 UTC
Fixed the last issue. Now it should be ok.
Comment 5 Quality Engineering 2010-08-11 03:13:40 UTC
Integrated into 'main-golden', will be available in build *201008110001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/07fcde4aa720
User: Petr Pisl <ppisl@netbeans.org>
Log: #189002 -  Issue with indenting PHP files that use the alternate PHP format

The last fix for this issue.