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
 Autotext problem with selected code
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Xuma
New Member

USA
3 Posts

Posted - Jul 13 2007 :  7:42:27 PM  Show Profile  Reply with Quote
I'm using VAX 1557 with VS 2003.

If I select a block of code and then type '#', the block is immediately surrounded by #region...#endregion. What I want is to surround the block with #if...#endif but I never get the chance to enter the 'i' after the '#'. If I do not have a block of code selected, I am able to enter '#i' to expand the #if...#endif but then I have to manually move the code.

Do I have some configuration variable set incorrectly? It is not immediately obvious to me. All of the '#' autotext definitions are stock.

DF

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 14 2007 :  08:28:07 AM  Show Profile  Reply with Quote
When you select some code and press # you are actually using VA's Surround Selection feature:

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

which is different to autotext. It does look a bit like autotext, especially when you describe using it like this.

To use the autotext entries that work on selected text you need to trigger insert autotext. There is a toolbar button for this on the VA toolbar, or you can access the entries via VA's shift + right click menu, or you can assign a keyboard shortcut to the command VAssistX.InsertAutotext

Please be aware there is a bug in VA 1559 that removes the selection when you trigger VA's shift + right click menu in the editor, but you can still use this menu on selected text if you right click in the left hand margin. Hopefully this bug will be fixed in the next build, and it does not effect version 1557 which you are using.

We were recently discussing the idea of allowing autotext to work on selected text by just typing the autotext shortcut in this forum thread:

http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=6401

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

Xuma
New Member

USA
3 Posts

Posted - Jul 14 2007 :  4:25:07 PM  Show Profile  Reply with Quote
Thanks. It works if I use Insert Autotext, as you pointed out.

However, I think there are some inconsistencies in the documentation. The documentation that you referenced says that selection plus '#' works only for C/C++ and that it inserts the #if...#ifdef sequence with a variable of your choice after the #if. I was in C# code and selection with '#' generated a #region...#endregion surround. If seems to me that either 1) # should do nothing in this case (because it is not C/C++) or 2) that it should generate #if...#ifdef (because it is C#). I will take a look at the other forum topic that you suggested.

I'm not terribly bothered by this point, as long as I know how to use it. In the last two years, Visual Assist X has saved me more time than any productivity tool that I have ever used (and it is a long list).

DF
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 16 2007 :  08:17:28 AM  Show Profile  Reply with Quote
You are quite right about the documentation, I have asked someone to update it:

case=7717

It is very good news that you find Visual Assist so useful

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