Skip to content

Commit

Permalink
Fix NixOS#188
Browse files Browse the repository at this point in the history
Fixes NixOS#188
  • Loading branch information
piegamesde authored and infinisil committed May 14, 2024
1 parent 3bcb63c commit 7e1570c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Nixfmt/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ prettyItems sep items = prettyItems' $ unItems items
prettyItems' :: (Pretty a) => [Item a] -> Doc
prettyItems' [] = mempty
prettyItems' [item] = pretty item
-- Fix for https://github.com/NixOS/nixfmt/issues/188
prettyItems' [item, DetachedComments []] = pretty item
prettyItems' (item : xs) =
pretty item
<> case item of CommentedItem _ _ -> sep; DetachedComments _ -> emptyline
Expand Down

0 comments on commit 7e1570c

Please sign in to comment.