Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 How to sort lines with function name not type?

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
ndh 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();
}
7   L A T E S T    R E P L I E S    (Newest First)
accord 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.
feline 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
ndh 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 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.
accord 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.
ndh 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 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

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