Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364533 - Indentation for nested switch statement
Summary: Indentation for nested switch statement
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 8.0.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-22 23:48 EST by Roland Schulz CLA
Modified: 2020-09-04 15:20 EDT (History)
7 users (show)

See Also:
elaskavaia.cdt: review? (eclipse.sprigogin)


Attachments
patch (3.47 KB, patch)
2012-04-12 08:52 EDT, Elena Laskavaia CLA
elaskavaia.cdt: iplog+
elaskavaia.cdt: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.