Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I keep getting mixed tabs and spaces in a Visual Studio 2010 C# code window?

I have just been working on a C# file (Global.asax.cs) in a web application for the last hour or so, and I have been shown the prompt to "tabify" or whatever about four times. Each time I choose to tabify and save the files, yet at some seemingly random point later on, I get prompted again.

I am using ReSharper, yet this doesn't happen when I code at home, also using ReSharper. Only at work.

like image 254
ProfK Avatar asked Mar 14 '11 14:03

ProfK


People also ask

How do you fix mixed tabs and spaces?

Go into its settings and turn off "Fix Mixed Tabs"... If you have the default VS settings, tabs in the editor are converted to spaces. So (in theory) if you clicked Untabify when the message comes up, it should convert all tabs to spaces and the errors should not appear next time.

How do I delete all tabs in Visual Studio?

You set your Visual Studio options (Tools/Options/Text Editor) to use spaces instead of tabs and then you open a source file and Ctrl-E,D (Edit/Advanced/Format Document) and it will convert them all for you! Yay for automation!


1 Answers

Are you using the Productivity Power Tools VS 2010 extension? If so, go to Tools -> Options -> and choose Productivity Power Tools. Here you can turn off the option to Fix Mixed Tabs. This will turn off this warning.

Power Tools for Visual Studio 2010

Power Tools for Visual Studio 2012

Power Tools for Visual Studio 2013

Power Tools for Visual Studio 2015

like image 122
Justin Saraceno Avatar answered Sep 29 '22 11:09

Justin Saraceno