Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Curly bracket default position
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

KiTsuNe
New Member

3 Posts

Posted - Jan 19 2007 :  04:32:18 AM  Show Profile  Reply with Quote
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

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jan 19 2007 :  04:43:52 AM  Show Profile  Reply with Quote
vax options->text editor->c++-> disable "format after paste"

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Jan 19 2007 :  07:23:31 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

KiTsuNe
New Member

3 Posts

Posted - Jan 19 2007 :  7:42:11 PM  Show Profile  Reply with Quote
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?
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Jan 19 2007 :  11:17:54 PM  Show Profile  Reply with Quote
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).
Go to Top of Page

KiTsuNe
New Member

3 Posts

Posted - Jan 19 2007 :  11:56:29 PM  Show Profile  Reply with Quote
I see. I didn't notice that there are lots of things i can do with the IDE setting. Thank you very much.

KiT
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000