From 4495c13e6caa668b0a42ed92d040ccb06d0ce365 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Thu, 27 Aug 2020 09:11:04 -0700 Subject: [PATCH] fix: extra line --- src/Lean/Util/PPGoal.lean | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Lean/Util/PPGoal.lean b/src/Lean/Util/PPGoal.lean index dcecfee2d0..0f3eb75565 100644 --- a/src/Lean/Util/PPGoal.lean +++ b/src/Lean/Util/PPGoal.lean @@ -17,11 +17,14 @@ match mctx.findDecl? mvarId with let instMVars (e : Expr) : Expr := (mctx.instantiateMVars e).1; let addLine (fmt : Format) : Format := if fmt.isNil then fmt else fmt ++ Format.line; let pushPending (ids : List Name) (type? : Option Expr) (fmt : Format) : Format := - let fmt := addLine fmt; - match ids, type? with - | [], _ => fmt - | _, none => fmt - | _, some type => fmt ++ (Format.joinSep ids.reverse " " ++ " :" ++ Format.nest indent (Format.line ++ pp type)).group; + if ids.isEmpty then + fmt + else + let fmt := addLine fmt; + match ids, type? with + | [], _ => fmt + | _, none => fmt + | _, some type => fmt ++ (Format.joinSep ids.reverse " " ++ " :" ++ Format.nest indent (Format.line ++ pp type)).group; let (varNames, type?, fmt) := mvarDecl.lctx.foldl (fun (acc : List Name × Option Expr × Format) (localDecl : LocalDecl) => let (varNames, prevType?, fmt) := acc;