Skip to content

Commit

Permalink
Handles an edge case from #580
Browse files Browse the repository at this point in the history
  • Loading branch information
belav committed Feb 8, 2022
1 parent a338a6c commit b4b6ac0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ public class ClassName
/// Tabs here
/// </summary>
public class ClassName { }
}

public interface Interface
{
/// <summary>
/// </summary> tab here before <
void Method();
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@ public class ClassName
/// </summary>
public class ClassName { }
}

public interface Interface
{
/// <summary>
/// </summary> tab here before <
void Method();
}
5 changes: 3 additions & 2 deletions Src/CSharpier/DocPrinter/DocPrinter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,10 @@ private void AppendComment(LeadingComment leadingComment, Indent indent)
// * keeps the * in line
// */
var firstLineIndentLength =
firstLine!.Replace("\t", " ").Length - firstLine.TrimStart().Length;
firstLine!.Replace("\t", " ").Length
- firstLine.TrimStart().Replace("\t", " ").Length;
var secondLineIndentLength =
line.Replace("\t", " ").Length - line.TrimStart().Length;
line.Replace("\t", " ").Length - line.TrimStart().Replace("\t", " ").Length;
extraIndent = new string(
' ',
Math.Max(secondLineIndentLength - firstLineIndentLength, 0)
Expand Down

0 comments on commit b4b6ac0

Please sign in to comment.