Author |
Topic |
|
mwb1100
Ketchup Master
82 Posts |
Posted - May 18 2009 : 2:45:32 PM
|
My preference for the tab key is to insert spaces instead of tab characters. However, I've inherited a bunch of source files that actually vary as to whether they have tabs or spaces for indenting. The team's policy is to have any edits made to a file conform to the existing usage in the file.
It's quite a pain to have Visual Studio use different behavior for different documents - my current method is to work on the files using my settings then run files that use hard tabs through an entab utility.
It would be nice if something (VAX maybe) could determine when a file is opened that it currently uses one or the other setting and would dynamically change the editor's setting for that document to match.
I have no idea if this is possible (in particular I don't know if this setting can be changed on-the-fly), but if something could, for example, detect that if 80%+ of the lines that start with whitespace start with a hard tab then change the setting for that document, it would make my life a little easier.
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - May 23 2009 : 6:55:45 PM
|
I have asked internally to see what people make of this idea. I have ended up working in similar situations, so I understand your problem.
If we add this to VA then it is the thin end of the wedge for code formatting, which might be a good thing or a bad thing It is a very popular request, but it is also a somewhat tricky request.
You should be able to set up a pair of IDE macro's, one to turn on inserting tabs and one to turn it off. This would let you easily change the IDE settings via a couple of keyboard shortcuts or custom toolbar buttons. I know its not the same, but you might find it helps a bit. |
zen is the art of being at one with the two'ness |
|
|
mwb1100
Ketchup Master
82 Posts |
Posted - May 25 2009 : 5:24:25 PM
|
Thanks for considering this (I understand about the camel's nose under the tent, though).
The macro suggestion is a good one - I'll see if I can figure out how to write such a thing and get it integrated into VS. |
|
|
feline
Whole Tomato Software
United Kingdom
19021 Posts |
Posted - May 26 2009 : 11:55:17 AM
|
For the IDE macro, just record an IDE macro, then turn the setting on or off. When you read the resulting macro code you often find that instead of jumping through the dialog's there is a direct VBScript call to do what you want.
IDE Tools menu -> Macros -> Record TemporyMacro
or Ctrl-Shift-R if you prefer. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|