Skip to content

Commit

Permalink
Experiment 2
Browse files Browse the repository at this point in the history
  • Loading branch information
piegamesde committed Jan 23, 2024
1 parent 8a6aab1 commit 37203a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Nixfmt/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ isAbstractionWithAbsorbableTerm _ = False
isAbsorbable :: Term -> Bool
isAbsorbable (String (Ann _ parts@(_:_:_) _))
= not $ isSimpleString parts
isAbsorbable (Path _) = True
-- Non-empty sets and lists
isAbsorbable (Set _ _ (Items (_:_)) _) = True
isAbsorbable (List _ (Items (_:_)) _) = True
Expand All @@ -399,7 +400,7 @@ absorbRHS expr = case expr of
hardspace <> pretty open
<> (surroundWith line' . group . nest 2 . base) expr'
<> pretty close
-- Not all strings are absorbably, but in this case we always want to keep them attached.
-- Not all strings are absorbable, but in this case we always want to keep them attached.
-- Because there's nothing to gain from having them start on a new line.
(Term (String _)) -> hardspace <> group expr
-- Same for path
Expand Down

0 comments on commit 37203a6

Please sign in to comment.