Skip to content

Commit

Permalink
Fix parenthesized function application
Browse files Browse the repository at this point in the history
There was some weird edge case involving long lines and "simple" arguments
  • Loading branch information
piegamesde committed Feb 26, 2024
1 parent 6413a12 commit 6bd07b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Nixfmt/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ prettyApp indentFunction pre hasPost f a
pretty comment'
<> (
if isSimple (Application f a) && isJust (renderedFUnexpanded) then
(group' RegularG $ fromJust renderedFUnexpanded <> hardspace <> absorbLast a <> post)
(group' RegularG $ fromJust renderedFUnexpanded <> hardspace <> absorbLast a)
else
(group' RegularG $ renderedF <> line <> absorbLast a <> post)
)
Expand Down
2 changes: 2 additions & 0 deletions test/diff/apply/in.nix
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,6 @@
# ...
) { }
)

(badge "https://github.com/maralorn/haskell-taskwarrior/actions/workflows/haskell.yml/badge.svg" "https://github.com/maralorn/haskell-taskwarrior/actions")
]
2 changes: 2 additions & 0 deletions test/diff/apply/out.nix
Original file line number Diff line number Diff line change
Expand Up @@ -357,4 +357,6 @@
something
# ...
) { })

(badge "https://github.com/maralorn/haskell-taskwarrior/actions/workflows/haskell.yml/badge.svg" "https://github.com/maralorn/haskell-taskwarrior/actions")
]

0 comments on commit 6bd07b5

Please sign in to comment.