Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Curly bracket default position

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
KiTsuNe Posted - Jan 19 2007 : 04:32:18 AM
Is it possible, in the current release, to set the default position for the opening and closing curly brackets? For example, when creating a new method, I'd like to use this format:

public void MyClass{
...//code goes here.
}


but whenever I paste some codes, VS2005 always changes it to:

public void MyClass
{
...//code goes here.
}


which causes one extra line and I don't like the way it looks.

Is there anyway to solve this problem?
Thank you very much.

KiT
5   L A T E S T    R E P L I E S    (Newest First)
KiTsuNe Posted - Jan 19 2007 : 11:56:29 PM
I see. I didn't notice that there are lots of things i can do with the IDE setting. Thank you very much.

KiT
sean Posted - Jan 19 2007 : 11:17:54 PM
Have you tried playing around with the IDE settings?

Tools|Options|Text Editor|C#|Formatting|New Lines

It looks like the "New line options for braces" should all be unchecked for your style.

You probably also want to edit the VA autotext items if you haven't already (and are using autotext).
KiTsuNe Posted - Jan 19 2007 : 7:42:11 PM
Well, I'm using C# on VS2005.
The solution from bugfix does work for the existing curly brackets.
But it doesn't work for the pasted text.
Say... I paste the following:

public void MyClass{
if(x > 0){
...//code
}else{
...//code
}
}


it becomes:

public void MyClass{
if(x > 0)
{
...//code
}
else
{

...//code
}
}


Except for the VA options, do i have to configure anything else?
feline Posted - Jan 19 2007 : 07:23:31 AM
bugfix is quite right. To expand on this a little, VA's format after paste simply calls the IDE's format code function, so it will do what ever the IDE is configured to do with regard to code formatting.

For C++ there are very few options, but if you are working in C# then you get more formatting options from the IDE.
bugfix Posted - Jan 19 2007 : 04:43:52 AM
vax options->text editor->c++-> disable "format after paste"

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000