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
 Format after paste
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dpoulain
New Member

2 Posts

Posted - Oct 11 2010 :  10:12:21 AM  Show Profile  Reply with Quote
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.

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Oct 11 2010 :  12:11:36 PM  Show Profile  Reply with Quote
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.

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

dpoulain
New Member

2 Posts

Posted - Oct 11 2010 :  2:14:27 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Oct 13 2010 :  12:03:06 PM  Show Profile  Reply with Quote
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.

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