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
 Spaces inside parentheses of function call
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

deselekt
New Member

Russia
4 Posts

Posted - Oct 17 2016 :  10:57:26 AM  Show Profile  Reply with Quote
Hello.
I need to add extra spaces inside parentheses of function call, like this:
memcpy( &a, &b, sizeof( a ) );


How can I do that? I edited (...) snippet and added spaces there, but nothing happens. I am using build 2112 and Visual Studio 2015 Community Edition.

ChrisG
Whole Tomato Software

USA
290 Posts

Posted - Oct 17 2016 :  11:07:22 AM  Show Profile  Reply with Quote
Hello deselekt,

Visual Assist uses your Visual Studio automatic formatting settings. To modify these settings, please navigate to the following menu.
(Tools | Options | TextEditor | C/C++ | Formatting)

Each option has an example, making it simple to tweak the formatting to your liking.

Specifically, look for 'Insert space within parenthesis of an argument list' and other settings in the Spacing section.
Go to Top of Page

deselekt
New Member

Russia
4 Posts

Posted - Oct 17 2016 :  11:17:10 AM  Show Profile  Reply with Quote
This option is already checked. But I had to turn off Visual Studio formatting, because there are some things that could not be turned off, for example I can not format like this:

LPSTR lpszOneLongLine   = NULL;
DWORD dwShort           = 0;

The second line gets autoformatted with removing tabs indentation inside it. Also I do not like the way how spaces are added inside the parentheses of control blocks (only one space is added, it removes last space before ")" when I type ")", and does not add it again when i press Enter).
That's why I disabled Visual Studio autoformatting and working with VA formatting only.
Is there a way to add spaces inside parentheses using only VA with VS formatting disabled?

Edited by - deselekt on Oct 17 2016 11:17:35 AM
Go to Top of Page

ChrisG
Whole Tomato Software

USA
290 Posts

Posted - Oct 17 2016 :  11:29:51 AM  Show Profile  Reply with Quote
No, unfortunately there is no way to do that.

How did you disable Visual Studio auto formatting?

Visual Assist will still use the settings you have for Visual Studio formatting when you paste code if 'Format after paste' is enabled in the following menu.
(VAssistX | Visual Assist Options | Editor)

It is worth noting that you can undo the formatting after a paste by using (Ctrl+Z) immediately after pasting.
Go to Top of Page

deselekt
New Member

Russia
4 Posts

Posted - Oct 17 2016 :  11:37:47 AM  Show Profile  Reply with Quote
I just simply unchecked all checkboxes in (Tools | Options | Text Editor | C/C++ | Formatting | General), but there is still indentation and formatting on paste.
Go to Top of Page

ChrisG
Whole Tomato Software

USA
290 Posts

Posted - Oct 17 2016 :  11:41:25 AM  Show Profile  Reply with Quote
You can stop the formatting after paste by disabling the 'Format after paste' Visual Assist option I mentioned in the previous post.

That along with unchecking the options in the Visual Assist auto formatting General section as you have done should prevent any formatting of your code.
Go to Top of Page

deselekt
New Member

Russia
4 Posts

Posted - Oct 17 2016 :  11:52:32 AM  Show Profile  Reply with Quote
In fact I do not worry much about formatting after paste; I can even work with VS2015 auto formatting enabled if I know how to disable auto correction of indentation inside the code line, like in example mentioned above (tabs between dwShort and "= 0" get collapsed). If i know how to turn it off, I will turn on VS autoformatting and problem will be solved. Of course I can always type Ctrl+Z, but it's rather annoying.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2021 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000