Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Format after paste

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
dpoulain Posted - Oct 11 2010 : 10:12:21 AM
I'm using latest build (10.6.1833.0) on VS 2010.

When I paste code, it is not indented automatically. I checked 'Format after paste' in VA options.

For example in

if (a==0)
{
    printf("a=0\\n");
}


if I copy/paste third line outside if block, I get:

if (a==0)
{
    printf("a=0\\n");
}
    printf("a=0\\n");


The pasted line is not indented.
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 13 2010 : 12:03:06 PM
I am not quite sure what is going on here, but VS2010 with VA 1833, and the IDE is having no problems formatting the following code correctly for me:

void testFormattingOfOddComment()
{
//** Set the clear color to set alpha channel to zero 
		glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
}


When pasting code, if you are in the "middle" of a line, or at the very start of the line, before the white space, can sometimes make a difference.
dpoulain Posted - Oct 11 2010 : 2:14:27 PM
Sorry my mistake, the above code is a bad example as the pasted line is correctly indented.

But the following code is not indented while pasted:

//** Set the clear color to set alpha channel to zero 
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);

It is not indented because the comment starts with //**
I understand that this very minor bug is not caused by VA, but by VS2010.
feline Posted - Oct 11 2010 : 12:11:36 PM
VA asks the IDE to do the code formatting, rather than doing the formatting its self. Can you please select the lines you have just pasted and then trigger the IDE command:

Edit menu -> Advanced -> Format Selection

which is Ctrl+K, Ctrl+F for me. If the IDE does not reformat the code then something further up the file is probably confusing its formatting command. However if the IDE does format the code then something unexpected is happening with VA when you do the paste.

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