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
 Minor C++ switch() autocomplete annoyances
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

matthewm
New Member

7 Posts

Posted - Oct 14 2011 :  4:39:26 PM  Show Profile  Reply with Quote
In some cases, the following happens when autocompleting C++ keywords in a switch() statement with the "Commit selection at any character not valid in a symbol" option enabled:
- Typing "ca" and pressing space will expand to the "case" keyword followed by *two* spaces.
- Typing "br;" will expand to "break;;" instead of simply "break;". This is unlike typing e.g. "ret;" which will always correctly expand to "return;".

These can be easily reproduced by writing a switch statement, say simply switch(1) { }, then going inside the curly braces and typing a case or break as mentioned before.

I'm using VAX 10.6.1859 in VS2010 on Win7 x64.

sean
Whole Tomato Software

USA
2817 Posts

Posted - Oct 14 2011 :  9:15:29 PM  Show Profile  Reply with Quote
The case and break suggestions are hardcoded in VA Snippets. You can edit the defaults:
VAssistX | Tools | Edit VA Snippets

In the left hand tree, locate the C++ root node and expand it.
Locate "SuggestionsForType switch" and remove the last character on each line in the right hand pane.

I'm not sure that VA should compare the commit character to the last character of the inserted text, but editing the defaults will give you the behavior you seek.

Edited by - sean on Oct 14 2011 9:16:48 PM
Go to Top of Page

matthewm
New Member

7 Posts

Posted - Oct 15 2011 :  06:22:27 AM  Show Profile  Reply with Quote
Thanks for the quick reply, that did the job
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