From 391b2115269eb4820eb7defbd21a45da133919d0 Mon Sep 17 00:00:00 2001 From: piegames Date: Mon, 26 Feb 2024 20:00:43 +0100 Subject: [PATCH] Fix parenthesized function application There was some weird edge case involving long lines and "simple" arguments --- src/Nixfmt/Pretty.hs | 2 +- test/diff/apply/in.nix | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Nixfmt/Pretty.hs b/src/Nixfmt/Pretty.hs index 7057b9ac..71cceb6d 100644 --- a/src/Nixfmt/Pretty.hs +++ b/src/Nixfmt/Pretty.hs @@ -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) ) diff --git a/test/diff/apply/in.nix b/test/diff/apply/in.nix index a80d20d0..d8c22eb0 100644 --- a/test/diff/apply/in.nix +++ b/test/diff/apply/in.nix @@ -312,4 +312,6 @@ # ... ) { } ) + + (badge "https://github.com/maralorn/haskell-taskwarrior/actions/workflows/haskell.yml/badge.svg" "https://github.com/maralorn/haskell-taskwarrior/actions") ]