@@ -17,6 +17,7 @@ import Data.Bool (bool)
1717import Data.Char (isPunctuation, isSymbol)
1818import Data.Data hiding (Infix, Prefix)
1919import Data.List (intersperse, sortOn)
20+import Data.List.NonEmpty (NonEmpty ((:|)))
2021import Data.Text (Text)
2122import GHC
2223import Ormolu.Printer.Combinators
@@ -182,7 +183,7 @@ p_match' placer pretty style isInfix strictness m_pats m_grhss = do
182183 SplicePat _ _ -> True
183184 _ -> False
184185 txt (if needsSpace then "\\ " else "\\")
185− stdCase
186+ sitcc stdCase
186187 LambdaCase -> stdCase
187188 return inci'
188189 let
@@ -946,7 +947,12 @@ cmdTopPlacement = \case
946947
947948exprPlacement :: HsExpr GhcPs -> Placement
948949exprPlacement = \case
949− HsLam NoExt _ -> Hanging
950+ -- Only hang lambdas with single line parameter lists
951+ HsLam NoExt mg -> case mg of
952+ MG _ (L _ [L _ (Match NoExt _ (x:xs) _)]) _
953+ | isOneLineSpan (combineSrcSpans' $ fmap getLoc (x :| xs))
954+ -> Hanging
955+ _ -> Normal
950956 HsLamCase NoExt _ -> Hanging
951957 HsCase NoExt _ _ -> Hanging
952958 HsDo NoExt DoExpr _ -> Hanging