Bug 390157 - Do not format when format result is worse than original
Summary: Do not format when format result is worse than original
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: Next   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-23 17:16 EDT by Sergey Fukanchik CLA
Modified: 2020-09-04 15:24 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Fukanchik CLA 2012-09-23 17:16:03 EDT
The bug 329912 has been fixed in eclipse 3.6.1 for JDT but still the same problem remains in CDT. 

Code formatter shouldn't split the line when result is worse than the original line.

Original:
parse("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

Formatted:

void f() {
	parse(
			"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
}
Comment 1 Sergey Fukanchik CLA 2016-07-14 12:55:39 EDT
this bug still exists in eclipse neon
Comment 2 Sergey Fukanchik CLA 2016-07-14 16:52:58 EDT
Ok, this is somewhere in org.eclipse.cdt.internal.formatter.CCodeFormatter