Author |
Topic  |
|
ndh
Junior Member
 
13 Posts |
Posted - Sep 25 2012 : 01:48:30 AM
|
Hi, I want to sort selected lines with function name not type,like this class A { A B1(); B A1(); } -> class A { B A1(); A B1(); } |
|
accord
Whole Tomato Software
    
United Kingdom
3287 Posts |
Posted - Sep 25 2012 : 3:13:24 PM
|
Unfortunately, you cannot do that. But are you aware of VA Outline?
VAssist -> Tools -> VA Outline
You can easily rearrange your source code via drag-and-drop in this window which maybe an easier way to sort your source. Also, are you aware of alt+m list? This list already is in alphabetical order and you can even filter it by typing.
Furthermore, we are considering a VA Outline command to sort selected items alphabetically:
case=20370 |
 |
|
ndh
Junior Member
 
13 Posts |
Posted - Sep 26 2012 : 12:30:45 AM
|
I think switch to VA Outline is not convenience. Shortcut key is needed. VS has the box selection feature, so why not sort the lines from the first column of the selected area. |
 |
|
accord
Whole Tomato Software
    
United Kingdom
3287 Posts |
Posted - Sep 26 2012 : 11:39:18 AM
|
You can dock VA Outline, I usually keep it on my side of my monitor. It also convenient for navigation: try it in a cpp file, it will show just the symbol names, without the actual details. Speaking of which, this is one of the many advantage of the VA Outline window: you can actually rearrange (and maybe sort later) the implemented functions and method as well, because VA Outline handles them as a whole, so when you move a line in VA Outline, you actually move the method body as well. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19164 Posts |
Posted - Sep 26 2012 : 8:19:04 PM
|
Box selection assumes that all of the function names line up, and that you don't have code that looks like:
class A
{
virtual A B1();
longReturnTypeName A1();
}
which is actually quite common. |
zen is the art of being at one with the two'ness |
 |
|
ndh
Junior Member
 
13 Posts |
Posted - Sep 27 2012 : 10:22:21 PM
|
quote: Originally posted by feline
Box selection assumes that all of the function names line up, and that you don't have code that looks like:
class A
{
virtual A B1();
longReturnTypeName A1();
}
which is actually quite common.
Maybe we need a coding style formatter to format it to class A { virtual A B1(); longReturnTypeName A1(); } This style is clean. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19164 Posts |
Posted - Sep 28 2012 : 11:48:32 AM
|
Unfortunately the forum has not shown your formatting, but I am guessing you are talking about having VA line up the function names. We don't have any current plans to add code formatting to VA, partly because everyone who wants code formatting wants it to work slightly differently.
This FAQ entry has links to a couple of different code formatting tools that you might want to have a look at:
http://docs.wholetomato.com?W147
Alternatively, if your IDE has macros, you could try:
IDE Tools menu -> Macros -> Macro Explorer -> Samples -> VSEditor -> LineEmUp |
zen is the art of being at one with the two'ness |
 |
|
accord
Whole Tomato Software
    
United Kingdom
3287 Posts |
Posted - Sep 28 2012 : 1:24:43 PM
|
We are considering to add a command at some point to sort selected text based on the last word / symbol on the line:
case=32391
This is something that would work even without doing a code formatting, first. |
 |
|
|
Topic  |
|