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 242966 - Auto code formatting keeps adding tabs to code
Summary: Auto code formatting keeps adding tabs to code
Status: REOPENED
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 7.3.1
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-17 13:53 UTC by vortextangent
Modified: 2015-09-03 14:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (51.53 KB, text/plain)
2014-03-17 13:53 UTC, vortextangent
Details
Sample Code (1.52 KB, text/php)
2014-05-09 13:10 UTC, vortextangent
Details
Exported formatting settings (946 bytes, application/zip)
2014-05-09 13:12 UTC, vortextangent
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vortextangent 2014-03-17 13:53:19 UTC
When formatting a file, either on save or by right clicking and selecting from popup menu, certain sections of code keep getting extra tabs.  It happens most on files that mix php and html code and will generally only affect the html code portions.

Product Version = NetBeans IDE 7.3.1 (Build 201306052037)
Operating System = Mac OS X version 10.9.2 running on x86_64
Java; VM; Vendor = 1.6.0_65
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.65-b04-462
Comment 1 vortextangent 2014-03-17 13:53:22 UTC
Created attachment 146072 [details]
IDE log
Comment 2 Jiri Prox 2014-04-18 10:11:52 UTC
can you please provide sample of code and screenshot of formatting settings? Thanks
Comment 3 Vladimir Riha 2014-05-05 10:48:22 UTC
Please try it in NetBeans 8.0 and if you still see this problem, attach here a sample file to reproduce it. Thank you

Closing as incomplete, waiting for reporter's feedback.
Comment 4 vortextangent 2014-05-09 13:10:59 UTC
Created attachment 147206 [details]
Sample Code
Comment 5 vortextangent 2014-05-09 13:12:25 UTC
Created attachment 147207 [details]
Exported formatting settings
Comment 6 Vladimir Riha 2014-05-09 13:17:45 UTC
Thank you for the sample, reproducible so reopening.


Product Version: NetBeans IDE 8.0 (Build 201403101706)
Updates: NetBeans IDE is updated to version NetBeans 8.0 Patch 1.1
Java: 1.8.0_05; Java HotSpot(TM) Client VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Linux version 3.2.0-60-generic-pae running on i386; UTF-8; en_US (nb)
Comment 7 Milutin Kristofic 2015-09-03 14:50:38 UTC
I'm quite sure this is bug in php.

This is minimal case:
<?php if (isset($results['records'])) : ?>
    <pre style="float: left;">
                                    <code>Done.
                                        Number of programs: <?php echo $results['records']; ?>
                                    </code>
    </pre>
<?php endif; ?>


HTML calculated right values for <pre>, <code> PHP gets this values from doc.getProperty("AbstractIndenter.lineIndents"); And PHP will add more whitespaces.