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
 Comment specified items in snippets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kennyl
Ketchup Master

50 Posts

Posted - Aug 12 2010 :  01:15:08 AM  Show Profile  Reply with Quote
I wonder if there is a way to comment some "items" (e.g. $selected$, $clipboard$, etc.) in snippets.

For example, I need to create such snippet that dose the following things:
1. It enclose the selected text with some text
2. It comment out the selected text by prepending // at the beginning of each lines

So it would be nice if VA provide the special tag like $selected_commentout$, $clipboard_commentout$, etc.

Regards,
Kenny

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Aug 12 2010 :  03:47:45 AM  Show Profile  Reply with Quote
What about to use /*$selected$*/ and /*$clipboard$*/ ?

Also, you can use our "Surround with" snippets available from the context menu. There is a snippet which can comment out your selection putting // before each line.

Hope this helps.

Edited by - accord on Aug 12 2010 03:55:05 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Aug 12 2010 :  12:38:33 PM  Show Profile  Reply with Quote
To comment out lines by putting // at the start, just select the lines and press /

http://www.wholetomato.com/products/features/surround.asp

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

kennyl
Ketchup Master

50 Posts

Posted - Aug 13 2010 :  01:01:05 AM  Show Profile  Reply with Quote
quote:
Originally posted by accord

What about to use /*$selected$*/ and /*$clipboard$*/ ?

Also, you can use our "Surround with" snippets available from the context menu. There is a snippet which can comment out your selection putting // before each line.

Hope this helps.



1. /*$selected$*/ won't work when there is already /**/ inside the selection.
2. There is a tricky way though:
#ifdef 0
$selected$
#endif

But I want the selected "looks like commented out", so this is not the best solution.

2. I know "surround with" and pressing / can comment out selected lines, but what I want is to create my own snippet which will not only comment out them but also prepend & append some text surround them.

For example, I want to comment out the selected text, then I need to put some comment the beginning, like "01/01/2010 Moved to abc.cpp by Kenny".

So the snippet is supposed to be:

// $MONTH_02$/$DAY_02$/$YEAR$ Moved to abc.cpp by Kenny
$selected_commentout$
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Aug 16 2010 :  04:06:21 AM  Show Profile  Reply with Quote
Are you aware that "surround with" snippets are only accessible through the context menu? (unless you overwrite the snippet for shift+#) So commenting out the block then writing a comment using the //- may me easier. Also, you would need to change the snippet frequently to keep your message actual.

What do you think?
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