Home Dashboard Directory Help
Search

Tabify/Untabify Selected Lines Does not Work by charles_cotton


Status: 

Closed
 as By Design Help for as By Design


5
0
Sign in
to vote
Type: Bug
ID: 630217
Opened: 12/9/2010 1:41:32 PM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

The Edit | Advanced | Tabify/Untabify Selected Lines DOES NOT WORK. It works just fine in Visual Studio 6.0. What's going on with this Visual Studio 2010 product? It is FILLED with bugs!

I am attempting to use these features in the Visual C++ Editor.

Update: (A few minutes later). The feature does work sometimes. Specifically, it does not work with this code:

/* Define Docking Positions */
#define DPOS_NONE    0
#define DPOS_TOP        1
#define DPOS_LEFT        2
#define DPOS_RIGHT    3
#define DPOS_BOTTOM    4
#define DPOS_FLOAT             5

I tried it with other preprocessor instructions and it didn't work with them, either. Why can't it be consistent? Code is Code is Code, right?

It does appear to work with non preprocessor code.
Details
Sign in to post a comment.
Posted by SteveWeh on 4/1/2014 at 11:19 AM
This makes no sense. When I untabify something it's to preserve formatting. The only place I'd want or expect the tabs to left would be at the beginning of the line, so you changed the behavior to do the exact opposite. Interesting strategy. Who would need to use this at all now that it only does the start of the line? It's like you took away so much functionality of this feature that it's completely useless. You need to have the people that use the program drive the features. Not some word processing expert locked in a room somewhere. You don't even have keyboard Macros any more! You seem to be removing and destroying all the most useful editing features. You need to talk to the people that designed Visual Studio 6 to get the feel of a real usable code editor.
Posted by Capstoner on 11/14/2011 at 8:06 AM
I see this is by design and understand how to get back the desired functionality. I just want to state my opinion that this is a very stupid design. I understand the problem with changing literal strings, but the solution to that problem is to not modify literal strings. It is not even hard to do this the right way. Your design is flawed.
Posted by Microsoft on 2/1/2011 at 5:20 PM
Hi Charles (and Greg, John, & other readers),

Thank you for logging this issue. This behavior from the "Untabify Selected Lines" option is actually by design; I understand that you don't like it, but perhaps I can at least explain why it changed. The VS team received complaints that if all whitespace in the line is untabified, string literals are affected and a program's functionality can change, which is why we now only change the leading tab.

As GregM said, this behavior was changed a few releases ago and is not new to VS 2010, though it is different from VB/VC 6. However, there is a slightly different pair of commands, Edit.ConvertTabsToSpaces and Edit.ConvertSpacesToTabs, that will convert all selected whitespace. These are not on a menu by default, but you can easily bind one or both of them to a keyboard shortcut, put them on a menu, or run them from the Command Window. GregM explained how to add commands to a toolbar, and if you want to bind it to a keyboard shortcut, you can do so by going to Tools->Options->Environment->Keyboard, finding Edit.CovertTabsToSpaces, and choosing any shortcut you like. This should give the behavior you want.

Thanks again for using Visual Studio 2010 and sending your feedback!

Brittany Behrens
Program Manager, Visual Studio Editor team
http://blogs.msdn.com/b/visualstudio
Posted by GregM on 12/21/2010 at 8:06 PM
John, I agree, but Convert Tabs to Spaces works fine for me. I've added it to my standard toolbar.
Tools>Customize, select Commands, Toolbar, Standard toolbar, Add Command..., select Edit in Categories, then scroll down to "Convert Tabs to Spaces".
Posted by John Boncek on 12/17/2010 at 8:23 AM
Even if you select an area within a line, then choose Tabify or Untabify, it still changes only the white space at the beginning of the line, text which is not even selected! This should never have been changed from the MSVC 6.0 behavior.

Sincerely,
John Boncek
jboncek@hunter.com
Posted by John Boncek on 12/10/2010 at 2:40 PM
It''s been this way for many versions. I agree the 6.0 behavior was much more useful and I still open code files in 6.0 when I really have to fix up a mess.
Posted by Microsoft on 12/9/2010 at 6:48 PM
Thanks for your feedback.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by charles_cotton on 12/9/2010 at 5:46 PM
I don't see a 'convert to tabs' option in the Edit | Advanced menu. I did a search using the absolutely ridiculous Visual Studio 2010 on line 'Help' system, but was routed to one of Microsoft's many ridiculous web pages trying to get me to sign up for something, when I am already more than sufficiently 'signed up.'

So, if you could be so kind, how the heck do I 'convert to tabs' and 'convert to spaces?' Or is it a SECRET?

Thank you for your help!
Posted by GregM on 12/9/2010 at 3:53 PM
Tabify/Untabify now only work on leading tabs/spaces. You need to use "convert to tabs" or "convert to spaces" instead if you want to work on embedded tabs/spaces.
Posted by Microsoft on 12/9/2010 at 2:23 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.