Search code examples
visual-studio-2010tabsformattingspaces

In VS 2010, "Format document" command (ie: Ctrl-k, Ctrl-d) swap tabs to spaces although set reverse in options


If you use the "Format Document" command (ie: Ctrl-k, Ctrl-d) in Visual Studio 2010, the final result is a document where all of the tabs are swapped with spaces.

All that happens although I have set Tools-Options-Text Editor-C#-Tabs to: <Smart, 4, 4, Keep tabs>


Solution

  • I found my bug.

    It was with all my XAML file that I had my problems. I just realised that there is 2 differents way to fix my bug:

    • Set the "Tabs" option for general document (if you haven't modify the XAML "Tabs" option).
    • Set the "Tabs" options directly in the XAML option section.

    Thanks Eric