Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 C++: Autoindentation of multiline func definitions

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
dave_lf Posted - Sep 26 2013 : 12:31:47 PM
Suppose I have a function defined like so:

void SomeReallyReallyLongQualifiedFunctionName( int p1, int p2,
   int p3 )
{
   ...
}


Now I decide I want to add a NameSpace::MyClass object as a fourth parameter. As soon as I type the second :, VA adds a bunch of tabs to indent the second line as shown (I had to type spaces here instead of tabs to get it to show up):

void SomeReallyReallyLongQualifiedFunctionName( int p1, int p2,
                                               int p3, NameSpace:: )
{
}


I'm reasonably sure it's VA doing this because the behavior goes away if I disable it.

Is this a bug or a feature? If it's a feature, is there any way to disable it (I don't see anything relevant looking in the settings)?
11   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Nov 18 2013 : 3:05:06 PM
case=77157 is fixed in build 2007
dave_lf Posted - Sep 27 2013 : 12:03:26 PM
Great, thanks. And you're correct, I don't have "Get content from default Intellisense" checked.
sean Posted - Sep 27 2013 : 12:00:41 PM
Sorry for the trouble. Will be fixed in the next release. case=77157
sean Posted - Sep 27 2013 : 11:12:10 AM
Ok - I was able to repro. The format does not occur if "Get content from default Intellisense" is checked in the VA Options dialog on the Advanced | Listboxes page. Investigating...
sean Posted - Sep 27 2013 : 11:07:20 AM
And what settings do you have in the VS Options dialog at:
Text Editor | C/C++ | Tabs
sean Posted - Sep 27 2013 : 11:05:17 AM
When you type "NameSpace::" are you typing all of that or are you using any listbox completions?
dave_lf Posted - Sep 27 2013 : 11:01:46 AM
VASSISTX > Enable/Disable Visual Assist X

Also, for what it's worth, if I select code formatted as in example one a choose EDIT > Advanced > Format Selection, Visual Studio applies this same "correction". So it seems that the VS autoformat action is being triggered for some reason when I type ::.
sean Posted - Sep 27 2013 : 10:58:47 AM
What method are you using to disable Visual Assist?
dave_lf Posted - Sep 27 2013 : 10:50:50 AM
No, I didn't have that checked. I actually went through and disabled all my other extensions and addons and unchecked every single VA setting, and I still get this behavior if and only if VA is enabled. Maybe it is a built-in Visual Studio feature that VA disables or overrides when it is loaded?

I've been looking for the VS C++ text formatting options, but it seems most of them were removed from the GUI in 2012...
sean Posted - Sep 26 2013 : 7:25:03 PM
I don't think this is a feature of VA. It looks like a feature of Visual Studio however I'm not able to repro with that example. The Visual Studio feature is most often seen at work in switches when typing a case statement.

Do you have 'Format after paste' enabled (VA Options | Advanced | Corrections)? If so, try disabling that to see if it makes a difference.
dave_lf Posted - Sep 26 2013 : 12:42:20 PM
I should add:
VA 10.7.1940.0 built 2013.05.30
VS2012 Professional with update 3 (11.0.60610.01)

Edit to add: I updated to 10.8.2001.0 today and the behavior is still there. And another detail I just figured out: this only happens if the start of the function definition is all the way at the left margin.

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