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 256569 - Formatting for JSP escape mode is not remembering prior context [regression]
Summary: Formatting for JSP escape mode is not remembering prior context [regression]
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 8.1
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-12 21:57 UTC by brettryan
Modified: 2015-11-13 15:12 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 brettryan 2015-11-12 21:57:41 UTC
I know this used to work properly but it's at some point broken and gone unnoticed, I tend to use JSTL now days so didn't notice this breaking.


Steps to reproduce
------------------
1. Create a new JSP
2. Enter the text:

<% if (true) { %>
<% if (true) { %>
<% } %>
<% }%>

3. Invoke Source > Format

Expected result
---------------
Source should be reformatted as

<% if (true) { %>
<%     if (true) { %>
<%     } %>
<% }%>

Actual result
-------------
Nothing happens.

Try with other variations for even stranger formatting behaviour, like placing the escapes on their own lines, i.e.

<%
    if (true) {
%>
<%
    if (true) { %>
<%
    }
%>
<%
    }
%>
Comment 1 mclaborn 2015-11-13 15:12:15 UTC
This is probably the same problem:

Given the JSP fragment below...
(In case it doesn't format properly, the div is indented in from the java code by 2 spaces.)  The cursor is immediately after the = on the div line.  If I paste something in at the cursor point, the div line is shifted left 2 spaces, so that it lines up with the java lines.

I think it should remain indented. 

<% if (order.hasPackSlipPrinted()) { %>
  <div>Packslip printed <%= %></div>
<% } %>