A customer posted this to my forum:
I'm pretty OCD about indenting and white space. Indenting helps me keep track of opening and closing tags.
Today for the first time I noticed a problem in the editor. Indenting one line works as expected, I get a tab char for every time I press the "tab" key.
However, if I select multiple lines that all start at the left edge, I get a tab char the first time and just spaces after that.
Then it gets goofier. If I uncheck "smart indent", then I get just spaces for tab and ctrl tab, even tho "Use tab char" is checked.
And I don't understand why a tab would get me tab characters, but ctrl tab would move back one space at a time. I think something has changed in the editor.
I suppose my first question would be how do I get sedIndent to indent several selected lines (or just one line with no selected text) using tab characters instead of spaces when vsUseTabs is set? sedTabOrIndent works if no text is selected but selecting several lines to indent and then using sedTabOrIndent deletes the selection and replaces it with a tab character.
Comments
1. Save the cursor position
2. Get start and end of the selection span
3. Issue BeginCompoundEdit
4. Use a for loop to alter each line - in your case insert a tab or spaces at the start
5. Issue EndCompoundEdit
6. Restore the cursor position
It works fine and is ismple for users (and us).
Does that help?
John C