This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 399143 - [bug] Default format preferences are not read in by default
Summary: [bug] Default format preferences are not read in by default
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: VJET (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Justin Early CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-25 20:56 EST by Justin Early CLA
Modified: 2017-04-11 15:12 EDT (History)
1 user (show)

See Also:


Attachments
Fix this bug. (1.33 KB, patch)
2013-01-30 09:39 EST, Jack Liu CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Early CLA 2013-01-25 20:56:40 EST
Create new VJET project
Create new JS file with this content

/**
 * Indentation
 */
function foo(data) {
	var abc = 1;
	var xyz = 'one';
	switch (data) {
	case 0:
		abc = 0;
		xyz = 'zero';
		break;
	default:
		abc = -1;
		xyz = 'unknown';
	}
	if (document.form1.year.value > 2000) {
		abc += 27;
	} else if (document.form1.year.value > 1900) {
		abc += 19;
	} else {
		abc = 0;
	}
}

Control + shift + F

content changes to this:

/**
 * Indentation
 */
function foo(data){
var abc=1;
var xyz='one';
switch(data){
case 0:
abc=0;
xyz='zero';
break;
default:
abc=-1;
xyz='unknown';
}
if(document.form1.year.value>2000){
abc+=27;
}else
	if(document.form1.year.value>1900){
	abc+=19;
	}else{
	abc=0;
	}
}

Expected this from Eclipse [built in] profile

/**
 * Indentation
 */
function foo(data) {
	var abc = 1;
	var xyz = 'one';
	switch (data) {
	case 0:
		abc = 0;
		xyz = 'zero';
		break;
	default:
		abc = -1;
		xyz = 'unknown';
	}
	if (document.form1.year.value > 2000) {
		abc += 27;
	} else if (document.form1.year.value > 1900) {
		abc += 19;
	} else {
		abc = 0;
	}
}
Comment 1 Jack Liu CLA 2013-01-26 03:01:17 EST
Cannot reproduce this bug.
Case 1:
existing workspace + create vjet project + create js file

Case 2:
clean workspace + vjet perspective + create vjet project + create js file

Case 3:
clean workspace + resource perspective + create vjet project + create js file

Could you please try to reproduce it again
or give more detail on how to reproduce it?
Comment 2 Jack Liu CLA 2013-01-29 10:59:31 EST
Also,there are two "format" menus in the VJET editor context menu.
Comment 3 Jack Liu CLA 2013-01-30 09:39:40 EST
Created attachment 226318 [details]
Fix this bug.

Fixed.
It is caused by this.tab_char and this.tab_size
Comment 4 Justin Early CLA 2013-03-07 18:33:03 EST
Jack fixed this I merged it into main