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 80047 - wrong cursor possition in scriptlets indentation
Summary: wrong cursor possition in scriptlets indentation
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on: 79366
Blocks:
  Show dependency tree
 
Reported: 2006-07-12 11:53 UTC by Jindrich Sedek
Modified: 2016-07-07 08:54 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
source code that invoke wrong code indentation (724 bytes, text/plain)
2006-07-12 11:54 UTC, Jindrich Sedek
Details
snap shot (1.41 KB, image/png)
2006-07-12 11:55 UTC, Jindrich Sedek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Sedek 2006-07-12 11:53:12 UTC
Create new web application
Delete all content of the index.jsp and paste content of the attatched file into
editor
set the cursor possition to 21:54   "<% if (true){|"
press Enter
cursor possition is always on 22:13 not acording to the indentation of "if"
Comment 1 Jindrich Sedek 2006-07-12 11:54:50 UTC
Created attachment 31758 [details]
source code that invoke wrong code indentation
Comment 2 Jindrich Sedek 2006-07-12 11:55:57 UTC
Created attachment 31759 [details]
snap shot
Comment 3 Tomasz Slota 2006-08-03 12:23:12 UTC
Fixed together with issue 79366.
Comment 4 Jindrich Sedek 2006-08-04 09:33:43 UTC
Scriptlets indentaion still doesn't work well
use this code:

        <%  if(true){
            switch(age){
                case 10:
                    a=b;|
            }
        }
        %>

press enter at the possition of "|" and continue writing for example with 
case 20:
 c=d;
default:
 sayHallo(); 

code is indented like this:

        <%  if(true){
            switch(age){
                case 10:
                    a=b;
                    case 20:
                        c=d;
                        default:
                            sayHallo();
            }
        }
        %>
Comment 5 Tomasz Slota 2006-09-11 16:49:28 UTC
removing the fix-in-55 tag: a regression; bad user experience, upgrading to P2.
Comment 6 Tomasz Slota 2007-11-02 13:52:51 UTC
Problems with new line indent in the switch statement are still reproducible, although the behavior is slightly different now - the caret returns to column 0 
(which is probably better for us). 

 We still rely on the old, unsupported java infrastructure for new line indent in the scriptlets. An embedding-friendly JavaIndentTask will not be implemented 
in 6.0.
Comment 7 Marek Fukala 2007-11-02 14:21:38 UTC
I belive the case reformat in java works because they "listen" on : char and invoke some indentation code when user
types the char behind case. I'll look at the java implementation, maybe it is easy to enable in JSP. Adding fix-in-60
just to remind myself to look at the issue, I'll turn the issue back to future if it is hard to fix.
Comment 8 Marek Fukala 2008-02-25 16:38:54 UTC
Tome, can you please reevaluete this one? Thanks
Comment 9 Jiri Prox 2008-04-11 01:20:50 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 10 pslechta 2008-08-22 14:43:36 UTC
The first example (pos 21:54) works for me. The second example (switch statement) does not work ("smart enter" does not
work).
Tested with NB 6.5 (Build 080808).
Comment 11 David Konecny 2009-03-16 02:56:06 UTC
Another Java formatter issue. Mila, Dusan, let us know if you need something from JSP/HTML formatter.
Comment 12 Peter Pis 2009-09-09 13:59:50 UTC
Product Version: NetBeans IDE Dev (Build 200909071948)
Java: 1.5.0_20; Java HotSpot(TM) Client VM 1.5.0_20-141
System: Mac OS X version 10.5.8 running on i386; MacRoman; en_US (nb)

First case works, but the second one doesn't. 
Comment 13 Dusan Balek 2012-05-16 12:42:17 UTC
To solve the second problem, JspJavaIndentTask should be rewritten to the new Editor Indentation SPI.
Comment 14 Martin Balin 2016-07-07 08:54:16 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss