Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364533

Summary: Indentation for nested switch statement
Product: [Tools] CDT Reporter: Roland Schulz <roland>
Component: cdt-editorAssignee: Project Inbox <cdt-editor-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: cdtdoug, eclipse.sprigogin, elaskavaia.cdt, ibelkov, malaperle, spakpower, yevshif
Version: 8.0.1Flags: elaskavaia.cdt: review? (eclipse.sprigogin)
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch elaskavaia.cdt: iplog+, elaskavaia.cdt: review?

Description Roland Schulz CLA 2011-11-22 23:48:07 EST
For the code:

int a;
main() {
	switch (a) {
	case 0:
		switch (a) {
		default:
		}
		break;
	case 1:

	}
}

Source->Correct Indentation
moves "case 1" one level to the right. As if "case 1" belonged to the nested switch.

Source->Format indents the code correctly.

Reproducible: always
Comment 1 Elena Laskavaia CLA 2012-04-12 08:52:00 EDT
Created attachment 213893 [details]
patch
Comment 2 Sergey Prigogin CLA 2012-04-12 12:45:54 EDT
(In reply to comment #1)
Could you please add a test case for this issue to CIndenterTest. Thanks.
Comment 3 Dartz Power CLA 2015-05-28 11:03:21 EDT
Seems that it's broken again.

"Source -> Correct Indentation" doesn't indent correctly whereas "Source -> Format" does.