Author |
Topic |
|
KiTsuNe
New Member
3 Posts |
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 |
|
bugfix
Tomato Guru
Germany
324 Posts |
Posted - Jan 19 2007 : 04:43:52 AM
|
vax options->text editor->c++-> disable "format after paste" |
http://www.mf-sd.de |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
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. |
zen is the art of being at one with the two'ness |
|
|
KiTsuNe
New Member
3 Posts |
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?
|
|
|
sean
Whole Tomato Software
USA
2817 Posts |
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
New Member
3 Posts |
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 |
|
|
|
Topic |
|