T O P I C R E V I E W |
kennyl |
Posted - Aug 12 2010 : 01:15:08 AM 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 |
4 L A T E S T R E P L I E S (Newest First) |
accord |
Posted - Aug 16 2010 : 04:06:21 AM 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? |
kennyl |
Posted - Aug 13 2010 : 01:01:05 AM 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$ |
feline |
Posted - Aug 12 2010 : 12:38:33 PM To comment out lines by putting // at the start, just select the lines and press /
http://www.wholetomato.com/products/features/surround.asp |
accord |
Posted - Aug 12 2010 : 03:47:45 AM 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. |