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" replaces tabulation by spaces
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jbb
New Member

Canada
5 Posts

Posted - Dec 11 2015 :  10:07:16 AM  Show Profile  Reply with Quote
Hello,

I'm using VA version 10.9.2083.0 built 2015.11.18 on VS2015

I noticed that in C#, "Format after paste" option sometimes converts tabulations into spaces.

Consider this code (with only tabulations):
protected override void Initialize()
{
base.Initialize();
}

If I copy the first line, and paste it at the beginning of the method like this:
protected override void Initialize()
{
protected override void Initialize()
base.Initialize();
}

Then the tabulations copied are changed into spaces (see attached image)

I can only reproduce this case when the option is enabled.

Thanks.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Dec 11 2015 :  5:24:12 PM  Show Profile  Reply with Quote
Sorry, the attach image feature doesn't seem to work at the moment.

Can you please try setting the below option to see if it helps?
Tools -> Options... -> Text Editor -> C# -> Tabs -> Keep tabs

(Visual Assist uses Visual Studio's format feature to format the block after paste.)

Edited by - accord on Dec 11 2015 5:24:57 PM
Go to Top of Page

jbb
New Member

Canada
5 Posts

Posted - Dec 14 2015 :  08:07:48 AM  Show Profile  Reply with Quote
This setting is already set for all languages.

The format after paste works usually as expected, but not in that case.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Dec 14 2015 :  6:26:39 PM  Show Profile  Reply with Quote
The good news is that I am seeing the same problem. The bad news is that I am seeing this problem even when VA has never been installed. So what ever is causing this, its not us.

I have made sure the code block is indented with tabs, the entire file has been indented only with tabs, and in the IDE C# options, it is set to keep tabs. Yet when I copy and paste the line, I end up with indented with spaces.

Can you try a quick test for me please, after the paste, use Ctrl-Z, do a single undo. What happens? For me, the spaces are replaced with tabs.

Turning off:

IDE tools menu -> Options -> Text Editor -> C# -> Formatting -> Automatically format on paste

helps a bit, but if I then trigger:

IDE Edit menu -> Advanced -> Format Selection

the tabs are replaced with spaces. Apparently VS2015 believes C# must use spaces, regardless of your settings.

You might want to try reporting this to Microsoft, and see what they say:

https://connect.microsoft.com/VisualStudio/

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

jbb
New Member

Canada
5 Posts

Posted - Dec 14 2015 :  7:39:51 PM  Show Profile  Reply with Quote
As usual, using Ctrl-Z cancels the formatting, so here the spaces are replaced by tabulations. I already tried that ;-)

I can also reproduce the case following the steps you provided.
Thanks for the suggestion, I will report this bug to Microsoft.

Thank you.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Dec 14 2015 :  9:33:18 PM  Show Profile  Reply with Quote
Sorry I was not more help, it seems an odd bug to have slipped past Microsoft. Personally I also prefer tab indented files, but it is an issue where people have strong feelings. Regardless, if the setting is there, I expect it to work.

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