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
 Technical Support
 How to surround a selection with something
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

dingweed
Senior Member

37 Posts

Posted - Jun 22 2004 :  12:55:15 PM  Show Profile
Say I have a peice of code that I wanna pad with /// in C++
Ex:

if(somethig)
{
}

I want
/// if(something)
/// {
/// }

In C# it's done by IDE by pressing ///
I need the same functinality but for C++ (I got a nice XML comment parser for C++ that parses XML style comment into MSDN like documentation). But padding code with tripple slash is a problem.

If I create this kind of macro in VA.X
///
/// %0
///

and my selelction is more then 1 line VA.X pads only the first line and leaves everything else untouched. If there a way to make VA.X to padd all selection with /// not just the first line?

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jun 22 2004 :  5:48:54 PM  Show Profile
i suspect you cannot do this with VAX, at least not easily. you can add double slash // to the beginning of a selected set of lines, but i don't know of any setting for how many slashes to insert. i am fairly certain it is hard coded.

personally i would just do this using search and replace in vim, www.vim.org

however, this is a bit extreme unless you are already experienced with vim

using VS .NET 2002 and a new unnamed cpp file in my current project, the following works wonders

select the lines you want to change
press ctrl_h for the find and replace dialog
at the bottom tick "use" and pick "regular expressions"
in find what put the single character ^
in replace with put the three slashes followed by a space, "/// "
now press the replace all button

for a more complex search and replace i would need to check the online help for VS's version of regular expressions. everyone does it slightly differently, just to keep you on your toes

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

support
Whole Tomato Software

5566 Posts

Posted - Jun 23 2004 :  9:29:39 PM  Show Profile
feline is correct. There is no way to surround a selection with three slashes. Our build-in code surrounds with only two.

http://www.wholetomato.com/products/features/surround.html?more=yes

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