Stop dumbindent dropping blank lines near braces

This commit is contained in:
Nigel Tao committed 2020-06-10 21:06:06 +10:00
1 parent 58c0862c50
commit b82396a3c6
5 files changed
+27 -26

No files matched your search

+7 -2
View File
@@ -334,6 +334,8 @@ func writeFuncImplSelfMagicCheck(b *buffer, tm *t.Map, f *a.Func) error {
}
func (g *gen) writeFuncImplPrologue(b *buffer) error {
oldLenB := len(*b)
// Check the initialized/disabled state and the "self" arg.
if g.currFunk.astFunc.Public() && !g.currFunk.astFunc.Receiver().IsZero() {
if err := writeFuncImplSelfMagicCheck(b, g.tm, g.currFunk.astFunc); err != nil {
@@ -365,10 +367,13 @@ func (g *gen) writeFuncImplPrologue(b *buffer) error {
// TODO: rename the "status" variable to "ret"?
b.printf("wuffs_base__status status = wuffs_base__make_status(NULL);\n")
}
b.writes("\n")
if oldLenB != len(*b) {
b.writes("\n")
}
// Generate the local variables.
oldLenB := len(*b)
oldLenB = len(*b)
if err := g.writeVars(b, &g.currFunk, false); err != nil {
return err
}