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 249760 - Can't format code in one line
Summary: Can't format code in one line
Status: CLOSED DUPLICATE of bug 175028
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 8.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-12 17:28 UTC by Christian Lenz
Modified: 2018-11-09 14:08 UTC (History)
1 user (show)

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 Christian Lenz 2015-01-12 17:28:56 UTC
I have this piece of code:
<div><div><h1></h1></div></div>

<div>TODO write content</div><div></div><script src="Scripts/functions.js"></script>

both lines are code in one line, I copied and pasted this so after this I wanted to format those code so I typed my hotkey (ctrl + k, ctrl + d) but nothing happened. I tested right click -> format, the same, nothing happened. This test was inside an html file.

After some brain celling, I tested it inside an xml file and inside this file, everything is working. After type my hotkey or over the context menu, I got this code:

<div>
   <div>
      <h1></h1>
   </div>
</div>


<div>TODO write content</div>
<div></div>
<script src="Scripts/functions.js"></script>

what is correct and what I expected inside an html or xthml file.


Regards

Chris
Comment 1 Vladimir Riha 2015-01-13 07:25:31 UTC
Reproducible. Formatting HTML (and CSS as well) is not adding new lines (I tried 7.1 with same result). Workaround is to put the new lines manually and then let formatter to fix indentation.


Product Version: NetBeans IDE Dev (Build 201501120001)
Java: 1.8.0_25; Java HotSpot(TM) Client VM 25.25-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_25-b17
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
Comment 2 Christian Lenz 2015-01-13 07:52:14 UTC
Maybe JS as well too, didn't test it whether it's already working or not.
Comment 3 Vladimir Riha 2015-01-13 07:59:47 UTC
JS does break lines :)
Comment 4 Milutin Kristofic 2015-03-23 16:30:05 UTC
Yes, this is caused by fact that Netbeans doesn't have Html Formatter. It can just indent code - moving beginning of lines. 

There is already enhancement for this, so I made this as duplicate of this enhancement. Thank you for reporting. We should fix this issue before next version

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