Question

When Visual Studio (2005) has Options -> Text Editor -> C/C++ -> Tabs -> Indenting set to Smart it will automatically indent code blocks and line up squiggly brackets, {}, as expected. However, if you hit enter inside a code block, move the cursor to another line, and then move it back, the inserted tabs are gone and the cursor is positioned all the way to the left. Is there a way to set Visual Studio to keep these tabs?

Was it helpful?

Solution

As far as I know, the only way to do that is to enter something (anything) on that line, then delete it. Or hit space and you'll never see it there until you return to that line.

Once VS determines that you've edited a line of text, it won't automatically modify it for you (at least, not in that way that you've described).

OTHER TIPS

This is an annoyance to myself as well. Anytime the code is reformatted the blank lines are de-tabbed. You might look at this: http://visualstudiogallery.msdn.microsoft.com/ac4d4d6b-b017-4a42-8f72-55f0ffe850d7 it's not exactly a solution but a step in the right direction

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top