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 236799 - End of line insertion generates invalid code
Summary: End of line insertion generates invalid code
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-05 22:06 UTC by everflux
Modified: 2015-08-08 02:01 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 everflux 2013-10-05 22:06:52 UTC
Product Version: NetBeans IDE 7.4 RC2 (Build 201309252201)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Linux version 3.8.0-32-generic running on amd64; UTF-8; en_US (nb)

given javascript code:

template: '<button class="btn"><i class="icon-location-arrow"></i> Demo</button>',

cursor is before closing single quote, pressing return

    template: '<button class="btn"><i class="icon-location-arrow"></i> Demo</button>\n\
',

Wonderful.
Now placing the cursor at end of line, so after \n\ - intention is to add another newline

Result is invalid code

template: '<button class="btn"><i class="icon-location-arrow"></i> Demo</button>\n\\n\
    
',

Expected result:

    template: '<button class="btn"><i class="icon-location-arrow"></i> Demo</button>\n\
\n\
',

(Maybe a user is 'stupid' if he does something so obviously wrong, but Netbeans should be smart enough to catch that.)
Comment 1 Vladimir Riha 2013-11-04 10:30:39 UTC
Reproducible

Product Version: NetBeans IDE Dev (Build 201311040001)
Java: 1.7.0_45; Java HotSpot(TM) Client VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.2.0-48-generic-pae running on i386; UTF-8; en_US (nb)
Comment 2 Petr Pisl 2015-08-07 11:48:51 UTC
Fixed in web-main.
Comment 3 Quality Engineering 2015-08-08 02:01:58 UTC
Integrated into 'main-silver', will be available in build *201508080002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/145334a836ef
User: Petr Pisl <ppisl@netbeans.org>
Log: #236799 - End of line insertion generates invalid code