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
 1738 bug
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Feb 11 2010 :  07:45:36 AM  Show Profile  Reply with Quote
VAX 1738, VS 2008 SP1.

Consider these classes: CMyItem, CYourItem.

class CMyItem {};
class CYourItem {};
CMyItem item;

Now I select "CMy" and start typing "CYo" and hit enter. Now VAX should replace "CMyItem" with "CYourItem", but instead I get "CYourItemItem".

You could argue that this is right behavior, but VAX does this inconsistently! If you would do the same for some other (completely different) class names, it would replace the whole string. E.g. "CMyCoolWindow" vs "CDialog.

This bug has been around for quite some time now. Very annoying since you cannot know what VAX will do when performing this operation.

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Feb 15 2010 :  09:37:36 AM  Show Profile  Reply with Quote
You should be accepting a listbox when you press Enter, and I suspect you are seeing a VA suggestion listbox. Since suggestions are VA's best guess, and this best guess is context and typing history dependent, you will get a different guess at different times.

But you should always know what is going to be entered, by looking at the current item in the listbox.

If this is happening without a listbox then this is a very different effect.

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

znakeeye
Tomato Guru

379 Posts

Posted - Feb 15 2010 :  10:09:55 AM  Show Profile  Reply with Quote
This has nothing to do with guesses and stuff. This is a pure ReplaceSel() bug. Yes, the listbox is shown.

Recall: CMyItemItem

The bug only appears when the last part of the new identifier name is already to the right of the cursor. Looks like an erroneous offset in string::find() :P
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Feb 16 2010 :  6:14:11 PM  Show Profile  Reply with Quote
Apologies, my mistake, I did not properly follow what you were doing.

The basic rule that VA follows here is if the text to the right of the caret "Item" in this case, is a recognised symbol it should be left there. If it is not a recognised symbol it should be deleted.

We don't know what you are intending, but you might be trying to turn the line:

CMyItem item;

into:
CYourItem.Item item;

Notice the dot after the class name. This has been discussed before, and basically you can always think of reasons to justify always deleting or always keeping the text after the caret. So we have this compromise action, we try to be helpful and sensible.

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