Visual Studio 2022 C# the cursor is right before the closing curly braces

89 Views Asked by At

I recently updated to VS Community 2022 (from VSC 2019). After writing a method (or class) when I wrote the opening curly brace it looked like this:

void SomeMethod()
{
}

With the cursor being before the closing brace.

Before the update this is what happened: (which I would very much like to recreate):

void SomeMethod()
{
    //cursor here
}

I tried changing the settings in Tools->Options>Text Editor->C#->Code Style->Formatting->New Lines, but that only achieved this:

void SomeMethod(){
}

The cursor being before the closing brace like in the first case.

I read a very similar question to mine - the only difference being that they had a Mac and I have Windows. The "soluton" was a VS update but it does not seem to effect Windows users...

1

There are 1 best solutions below

0
Minxin Yu - MSFT On

Enable option Leave block on single line . The opening curly brace would be like :

enter image description here

Then enter:

enter image description here