C# autocorrects my if statements
hello i recently changed from javascript to c# and it all works great, just one problem. it autocorrects my if statements. Dont really know how to explain more in detail, but take a look at these pictures instead:
How i want it:
How it autocorrects:
Thanks (:
Just curious, why pictures? Text is better for computer code, and what you have should be cut and pastable. Are you having trouble with the code-formatting? Either highlight and click the 00101 button, or simply add 4 spaces in front of each code line.
Sometimes slow thinking brings u down. I dont really know why i posted pictures, i just wanted to try to import images, hope you dont $$anonymous$$d, tho it got the job done! :)
Answer by Raresh · Apr 19, 2016 at 11:50 AM
If using Monodevelop: For the current project go to Project -> Solution Options -> Source Code -> Code Formatting -> C# Source Code -> C# Format -> Edit -> Braces. Then play around with the settings until you find the right setup for you. For your specific question you should set them to Next Line.
If you want the settings for new projects you might make, do the same thing, but this time go to Tools -> Options -> Source Code -> ...(like before). It will only apply these settings for new projects.
Also you might want to set up a keybind in order to force the whole document to format. To do that go to Tools -> Options -> Hotkeys and search for "Document Format" or something like that. When you will press the key combination it will format the whole document according to the current formatting settings.
Answer by Rumor · Apr 19, 2016 at 12:13 PM
Hope this helps:
In MonoDevelop menu bar click on "Project" > "Solution Options" .
In the new window that appears, Open the Source Code arrow.
Open the "Code Formatting" header on the left side.
Click on the C# source code header
On the right of the window, click on the C# format tab.
Click the edit button
Open the drop down "Catergory" and change it to Braces.
You will now see a list of setting to alter, these will. I would suggest if you always want the bracket on the next line to set most of them to "Next Line".
Your answer

Follow this Question
Related Questions
Unity Update is ignoring the GetKey part of my statement!? 2 Answers
SqrMagnitude intermittently doesn't work for if statement on prefab. (C sharp) 1 Answer
My "if" statement doesn't work? 2 Answers
If statement for direction the character is facing 0 Answers
If/ElseIf never reaches elseif 0 Answers