1st curly brackets "{" jumping one line when i copy-paste code

Hello,
So as the title says, whenever i paste code in my script, every first " { " will simply go down one line, heres an example:

Before copy-pasting:

 void Update() {
        print(myState);
        if (myState == States.menu) {
            state_menu();
        }

After:

 void Update()
 {
        print(myState);
        if (myState == States.menu)
 {
            state_menu();
        }

How can I stop/avoid this to happen in Visual Studio? Thanks in advance.

1 Like

Tools > Options > Text Editor > C# > Code Style > Formatting > New Lines (Or simply search for new lines in the options menu)

There you can set whether you want the opening brace to be placed on a new line for different cases.

1 Like

Also, the following link will help you regarding posting code exa.ples on the forum :slight_smile:


See also;

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms