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 204304 - Strange behavior on autocomplete for JavaScript files
Summary: Strange behavior on autocomplete for JavaScript files
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7
: P2 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-27 09:06 UTC by aatimofeyev
Modified: 2012-05-10 09:59 UTC (History)
2 users (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 aatimofeyev 2011-10-27 09:06:23 UTC
Product Version = NetBeans IDE 7.0.1 (Build 201107282000)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_25
Runtime = Java HotSpot(TM) Client VM 20.0-b11

Steps to reproduce:
1. Pick the js file for editing, it must contain inline brackets, single-line if for instance, use autocomplete feature on any object or variable (Ctrl+Space in my case)
2. Select anything from the list, push Enter
3. Autocomplete comes with the side effect - some spaces in all file are removed, for example:
"function() { $(this).dialog('close'); }" -> "function() {$(this).dialog('close');}"


Additional screenshots cleary demonstrate the issue (there is only "Enter" push between these 2 screenshots):
http://dl.dropbox.com/u/12874728/1.png
http://dl.dropbox.com/u/12874728/2.png
Comment 1 ghostnose 2011-12-09 15:32:41 UTC
I can confirm this behaviour with an additional more severe problem. I have noticed cases in which this deletes the first letter of the following statement.

I have noticed the behaviour usually occurs when using autocomplete to get a function rather than a member from an object.
Example:

for (i = 0; i < n; i++){
} foobar = 1;

obj = {
	f : function () {}
}; foobar = 2;

obj.//<-- do an autocomplete to fill in f here

Result:
for (i = 0; i < n; i++){
}foobar = 1; //space removed

obj = {
	f : function () {}
};oobar = 2; //first letter removed
Comment 2 Petr Pisl 2012-03-26 15:14:02 UTC
Reproducible.
Comment 3 Petr Pisl 2012-05-09 14:56:21 UTC
Fixed in web-main.
http://hg.netbeans.org/web-main/rev/121bac047d54
Comment 4 Quality Engineering 2012-05-10 09:59:25 UTC
Integrated into 'main-golden', will be available in build *201205100400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/121bac047d54
User: Petr Pisl <ppisl@netbeans.org>
Log: #204304 - Strange behavior on autocomplete for JavaScript files