- Home /
[MonoDevelop]How do I stop MonoDevelop automatically moving my if statements?
Before, in MonoDevelop, when you made an if statement like this:
if(condition)
{}
and pressed enter in the two curly brackets, it would change the if statement to this:
if(condition)
{
}
But in the new version of Unity with the UnityGui, it changes it to this:
if (condition) {
}
This is very annoying for me, as I have to manually adjust is to how it was before. Is there a way to stop MonoDevelop from doing it the 'new' way and do it the way it used to?
Answer by tanoshimi · Oct 19, 2014 at 09:55 AM
Tools -> Options -> Text Editor -> Templates
Scroll down and edit the code template for "if" to be how you want.
I changed it to
if ($expression$)
{
$selected$$end$
}
But it still gives me
if (condition) {
}
Changing it there changes it for future projects.
To change it for the current project right click the project and go to properties.
It's a silly thing monodevelop does, but there is a way to fix it :)
Sorry, but where do I find options for the current project?
HI @ashjack If you are using mac Clickon $$anonymous$$onodevelop-> Preferences -> Source Code -> CodeFormatting -> C# Source Code In that select c#Format tab, then edit. Then go to Categories -> Braces -> Statements.. Select Next line in that.
I tried this, but cannot find Templates option in 'Text Editor'. Is there any other way?