Why am I getting this behavior right after the if block? Am I missing something?
for (;;)
if (/*...*/)
{
// statements
}
// statements indented to match the if indentation instead of the for loop;
Why am I getting this behavior right after the if block? Am I missing something?
for (;;)
if (/*...*/)
{
// statements
}
// statements indented to match the if indentation instead of the for loop;
Visual Studio 2010 appears to be riddled with editor bugs. Indentation is particularly hosed.
Just wait until it starts moving your cursor to the beginning of the line every time you type a ':'.
If you close the file and reopen it that sometimes fixes the issue...for a little while anyway.
About the only way to keep VS doing indentation reasonably is to always use a block to enclose the statement controlled by a for
, if
, while
, etc. In your case that would mean:
for (;;)
{
if (/* ... */)
{
// ...
}
}
// further statements here indented to match for loop.