T O P I C R E V I E W |
mathewzhao |
Posted - Feb 02 2007 : 08:34:16 AM Visual Assist X has an option,"Text Editor->Correction->Insert () and closing } ) ] ' and 0 spaces between method name and ()",and the feature is really helpful.
However, I sometimes wish VAX can automatically add ');' rather than ')' .I have tried to add new entry in AutoText,and wish when I input a '(', VAX can add a ')' ,or when I input a '(`', VAX can add ');',just like 'for' and 'forr' in AutoText.
Unfortunately,it still doesn't work.As long as I type a '(', VAX will ignore my new entry in AutoText,and only add a ')'.
Could you give me a suggestion? thanks.
|
2 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Feb 02 2007 : 12:14:40 PM One thing to keep an eye on is the allowed characters for an autotext shortcut. See the "Shortcut" section here:
http://www.wholetomato.com/products/features/autotext.asp
As a way of automating this, there is a feature request to allow you to press the semi-colon in the middle of the line (in a function call really), somewhere where VA can reliably figure out that a semi-colon is invalid, and to automatically place this at the end of the line.
case=296
It is not quite the same as this, but it might help, if we ever try and do this. |
sl@sh |
Posted - Feb 02 2007 : 09:17:35 AM You do realize that to use the variant autotext entries for 'for' and 'forr' you still have to select and confirm the appropriate entry from the suggestion listbox? This method is rather different than what the autocompletion does - it just inserts the appropriate closing character without waiting for the user to confirm.
Since the opening '(' is used up by autocompletion, you would have to define an autotext rule *not* including the '('. However, the problem with that concept would be that you not only need to replace the text you just typed, but also the already inserted ')'.
The only way I can think of is to not type '(' at all: as a suggestion, define an autotext rule for ';)' which then will be replaced by '();'. Or think of another tag that would be easier to memorize (and not get in the way of real code). Then, when you want '();', don't type the '(' at all, just ';)'. Be warned however: this method will still require you to select and confirm the suggestion '();' from a listbox, so with respect to typing you're not saving any work!
P.S.: I just remembered that recently someone suggested to have VAX automatically put the ';' typed after a '(' right behind the newly created ')'. (or somewhere along these lines) This does sound a lot like your suggestion. Maybe feline remembers what topic that was? |
|
|