1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 21:16:12 +03:00

No opening linebreak if first node is a patch

This commit is contained in:
Timothy Clem 2017-02-17 13:54:20 -08:00
parent 696e4f6a8c
commit 6e718a7804

View File

@ -27,7 +27,8 @@ printDiff diff level = case runFree diff of
(Free (Join (_, annotation) :< syntax)) -> pad' level <> "(" <> showAnnotation annotation <> foldr (\d acc -> printDiff d (level + 1) <> acc) "" syntax <> ")"
where
pad' n = if n < 1 then "" else pad n
pad n | n < 1 = "\n"
pad n | n < 0 = ""
| n < 1 = "\n"
| otherwise = "\n" <> mconcat (replicate n " ")
printTerm :: (HasField fields Category, HasField fields SourceSpan) => Term (Syntax t) (Record fields) -> Int -> Text