| Author |  Topic  |  | 
              
                | jbbNew Member
 
  
 
                Canada5 Posts
 | 
                    
                      |  Posted - Dec 11 2015 :  10:07:16 AM     
 |  
                      | 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.
 |  | 
              
                | accordWhole Tomato Software
 
      
 
                United Kingdom3287 Posts
 | 
                    
                      |  Posted - Dec 11 2015 :  5:24:12 PM     
 |  
                      | 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
 |  
                      |  |  | 
              
                | jbbNew Member
 
  
 
                Canada5 Posts
 | 
                    
                      |  Posted - Dec 14 2015 :  08:07:48 AM     
 |  
                      | This setting is already set for all languages. 
 The format after paste works usually as expected, but not in that case.
 |  
                      |  |  | 
              
                | felineWhole Tomato Software
 
      
 
                United Kingdom19247 Posts
 | 
                    
                      |  Posted - Dec 14 2015 :  6:26:39 PM     
 |  
                      | 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
 |  
                      |  |  | 
              
                | jbbNew Member
 
  
 
                Canada5 Posts
 | 
                    
                      |  Posted - Dec 14 2015 :  7:39:51 PM     
 |  
                      | 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.
 |  
                      |  |  | 
              
                | felineWhole Tomato Software
 
      
 
                United Kingdom19247 Posts
 | 
                    
                      |  Posted - Dec 14 2015 :  9:33:18 PM     
 |  
                      | 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
 |  
                      |  |  | 
              
                |  |  Topic  |  |