Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Shortcut to surround line with a specific snippet

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
alanchen Posted - May 22 2018 : 05:27:18 AM
Hi,

I am using Visual Assist 10.7.1929.0. Now I can add try-catch block for a codeline by:

1. Select the codeline.
2. Go to �VAssistX -> Surround with VA Snippet -> try (�) catch ()�

However, this is not convenient since each time I need to access the menu and submenu items for multiple times. I also see there is a shortcut for �try� snippet. So I try to use shortcut instead, as follows:

1. Select the codeline.
2. Input �try�.
3. When the �try (�) catch ()� line appear, I press �Enter� key.

However, this time the try catch block will OVERWRITE the existing codeline, instead of surrounding it.

How to create a shortcut that can surround the codeline with a specific VA Snippet?

Thanks
4   L A T E S T    R E P L I E S    (Newest First)
feline Posted - May 23 2018 : 06:03:57 AM
You can easily do this in the current version of VA.
alanchen Posted - May 22 2018 : 7:27:02 PM
quote:
Originally posted by feline


in your current version, you could try changing the body for the default snippets "(...)" or "{...}" to have them do what you want, instead of their current default behaviour.



Sorry but I cannot understand you very well. The body of the default snippet is OK. The only problem is that I cannot find a shortcut that can surround a selected line. With the menu items, I can do that but that is not convenient.
sean Posted - May 22 2018 : 12:01:22 PM
See the Surround With edit field in the Snippet Editor; triggers can only be single characters.
feline Posted - May 22 2018 : 08:34:44 AM
This is easily available in more recent versions of VA, you can simply set a key that will trigger your snippet when you have selected text. You can download a trial version from here:

http://www.wholetomato.com/downloads/default.asp

in your current version, you could try changing the body for the default snippets "(...)" or "{...}" to have them do what you want, instead of their current default behaviour.

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