diff --git a/src/Nixfmt/Predoc.hs b/src/Nixfmt/Predoc.hs index 4f68f886..984dde1c 100644 --- a/src/Nixfmt/Predoc.hs +++ b/src/Nixfmt/Predoc.hs @@ -503,8 +503,8 @@ layoutGreedy tw doc = Text.concat $ evalState (go [Group RegularG doc] []) (0, [ put (cc + textWidth t, indents) $> [t] (cc, (ci, vi):indents) | textVI > vi -> put (cc + textWidth t, (ci, textVI):(ci, vi):indents) $> [t] - (cc, (ci, vi):indents) -> - put (cc + textWidth t, (ci, textVI):indents) $> [t] + (cc, indents) -> + put (cc + textWidth t, indents) $> [t] (_, _) -> error "unreachable, since indents is guaranteed to not be empty as invariant" where -- Start a new line