I am working with visual studio 2008 and all of a sudden automatic indentation stopped working. I am not sure why. For example: if I type:
if(true){开发者_如何学C
}
it will automatically get converted to
if (true)
{
}
But now it is NOT working that way. The only setting I changed was Tools-> Options -> Source Control -> Environment -> Checked In Items -> Editing -> Prompt for checkout. Before it was set to "Check out automatically".
Ensure that you don't have something in scope that is causing errors. Try ctrl + k + d. If that isn't fixing your indentation, chances are you have a syntax error some place.
By the way, the settings for indendation are under Options -> Text Editor -> [YourLanguage] -> Formatting.
The option is called "Automatically format completed block on }."
精彩评论