Skip to content

Commit

Permalink
Keep new lines before unsafe statements (#918)
Browse files Browse the repository at this point in the history
closes #917

Co-authored-by: Lasath Fernando <devel@lasath.org>
  • Loading branch information
belav and shocklateboy92 committed Jun 24, 2023
1 parent 33786d5 commit c9d473a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,10 @@ class ClassName
{
int* p = null;
}

unsafe
{
// should keep newline above this one
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ internal static class UnsafeStatement
public static Doc Print(UnsafeStatementSyntax node, FormattingContext context)
{
return Doc.Concat(
ExtraNewLines.Print(node),
Token.Print(node.UnsafeKeyword, context),
Node.Print(node.Block, context)
);
Expand Down

0 comments on commit c9d473a

Please sign in to comment.