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
 Shortcut to surround line with a specific snippet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

alanchen
Junior Member

11 Posts

Posted - May 22 2018 :  05:27:18 AM  Show Profile  Reply with Quote
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

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - May 22 2018 :  08:34:44 AM  Show Profile  Reply with Quote
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.

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - May 22 2018 :  12:01:22 PM  Show Profile  Reply with Quote
See the Surround With edit field in the Snippet Editor; triggers can only be single characters.
Go to Top of Page

alanchen
Junior Member

11 Posts

Posted - May 22 2018 :  7:27:02 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - May 23 2018 :  06:03:57 AM  Show Profile  Reply with Quote
You can easily do this in the current version of VA.

zen is the art of being at one with the two'ness
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