/** * Returns the line at the given number with any tabs before any * non-space character converted to spaces. * @param enddoc is just used to get the line. * @ret null if the given line is outside the bounds of the document. */ private static string GetUntabbedLine(EnvDTE.EditPoint enddoc, int lineNum) { if ((lineNum < 1) || (lineNum > enddoc.Line)) { return null; } else { string temp = enddoc.GetLines(lineNum,lineNum+1); string ret = ""; for (int i=0; i < temp.Length; i++) { if (temp[i] == '\t') { int spaces = enddoc.Parent.TabSize - (ret.Length % enddoc.Parent.TabSize); ret += new System.String(' ',spaces); } else if (temp[i] == ' ') { ret += temp[i]; } else { return ret + temp.Substring(i); } } return ret; } }