Sublime Forum

Indentation problem C++

#1

Hi,

my problem is basic, I hope it has not already been reported.

Let’s define two imbricated loops in a function :

int foo() {
	int dum = 0;

	for (int i = 1; i < 2;i++)
		for (int j = 1; j< 2; j++) 
			dum++;

		return dum;
	}

then the “return dum” is auto-indented to second column, while it should be indented to the first (I’m being a little fuzzy with the braces here, but the “return dum” should be out of the loops)

Is there any way to fix it ?

Thanks a lot !

victor

0 Likes