Author |
Topic |
|
kennyl
Ketchup Master
50 Posts |
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 |
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
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. |
Edited by - accord on Aug 12 2010 03:55:05 AM |
|
|
feline
Whole Tomato Software
United Kingdom
19022 Posts |
|
kennyl
Ketchup Master
50 Posts |
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$ |
|
|
accord
Whole Tomato Software
United Kingdom
3287 Posts |
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? |
|
|
|
Topic |
|