zig fmt: fix extra space after comma before multi line string

This commit is contained in:
Andrew Kelley
2018-05-29 03:25:03 -04:00
parent eda6898c5b
commit cd325e408e
2 changed files with 13 additions and 0 deletions

View File

@@ -1,3 +1,14 @@
test "zig fmt: 2nd arg multiline string" {
try testCanonical(
\\comptime {
\\ cases.addAsm("hello world linux x86_64",
\\ \\.text
\\ , "Hello, world!\n");
\\}
\\
);
}
test "zig fmt: if condition wraps" {
try testTransform(
\\comptime {

View File

@@ -1733,6 +1733,8 @@ fn renderToken(tree: &ast.Tree, stream: var, token_index: ast.TokenIndex, indent
}
},
Space.Space, Space.SpaceOrOutdent => {
if (next_token.id == Token.Id.MultilineStringLiteralLine)
return;
try stream.writeByte(' ');
return;
},