Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Tab completions overwriting next word

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
IanB Posted - Dec 19 2021 : 09:30:52 AM
Something that I encounter regularly is that I need to fix a line of code by inserting text at the start of the line.

Here is an example line:


The red underline error is due to the wrong string type being used. So I want to do a string conversion. I start typing the function name...


And Visual Assist immediately suggests the right thing! Great! I hit Tab (or Enter) and it overwrites the next word:



Whereas I was hoping for:



Default Visual Studio behaviour is the same as Visual Assist - replace not insert. Googling says that Resharper can be configured to either replace or insert - I can't verify since I don't have Resharper.
4   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Dec 20 2021 : 09:52:27 AM
Thank you for the very simple example, I am seeing exactly the same problem here. It turns out this is a known bug in the overwrite logic, known symbols are being replaced when you are accepting a function name:

case=140801

thankfully, as you are seeing, the never replace setting still works correctly in this case.
IanB Posted - Dec 20 2021 : 09:20:33 AM
I tried creating a new project to test if it is just my codebase that is breaking it, but I see the same behaviour on a simple test:

std::wstring MultiByteToWideChar(std::string s)
{
  return L"";
}

int main()
{
  std::string token("Hello world");
  return atoi(token.c_str());
}


Place the cursor before the 'token':

  return atoi(token.c_str());
              ^

Type 'M', tab, and it replaces 'token'.
IanB Posted - Dec 20 2021 : 09:06:02 AM
Yes, both context and definition fields look correct. Definition field is:
const Token& token = *value.tokens.cbegin()

I changed the registry value you linked (to 1 "never overwrite"). That works great!
feline Posted - Dec 20 2021 : 05:40:03 AM
Before starting the edit, if you place the caret into the symbol "token" does VA show anything in its context and definition fields? These are normally shown at the top of the editor window, and are where the Alt-M list comes from. VA should be showing you the correct details of this symbol.

I ask since the default behaviour for listboxes is to only remove unknown symbols from the right hand side of the caret. You can control this behaviour, telling VA never to remove the text to the right of the caret, with this setting:

https://support.wholetomato.com/default.asp?W640

but if VA knows the symbol then something is going wrong with the default behaviour, unless your system has been configured to always delete the text to the right of the caret, which is an option.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000