[TIP] Auto-format line breaks for braces using MS Visual Studio

Hi, I’ve been following along the course, currently in lesson 30-something. In a previous post, Rob had mentioned that he uses MS Visual Studio instead of MonoDevelop. I thought I’d give it a go and I liked the auto-complete and highlight feature for braces and such, but was irked by the fact that it automatically added a line break before your typed brace rather than after it during auto-complete. This adds an extra line in the code. It seems it’s just a matter of preference, and if you like this format, then stick with it. If not, then you would need to delete the white space before the bracket every time, which is annoying and can lead to careless manual errors. To change this, I found the following setting in the tools>options menu. Toggling this setting will add or remove the line break.

(To the moderator, if this is too obvious to add as a tip, or seems like such a no-brainer, then please feel free to delete it.)

3 Likes

You’re all good :wink:

Thanks for sharing, ironically I had provided another member with these details via a PM only the other day, so having a public post is very useful. :slight_smile:

1 Like

oo, well I for one didnt know that was there, or even if it was a thing…

spot on and thank you for sharing @zamond !

2 Likes

Privacy & Terms