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 c96cf9f commit 391b211
Show file tree
Hide file tree
Showing 2 changed files with 3 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")
]

0 comments on commit 391b211

Please sign in to comment.