From 4f9c2d15f6aa5484e2b9a26b325dc5edc338831b Mon Sep 17 00:00:00 2001 From: piegames Date: Tue, 6 Feb 2024 23:49:51 +0100 Subject: [PATCH] Experiment --- src/Nixfmt/Pretty.hs | 2 +- test/diff/comment/out.nix | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Nixfmt/Pretty.hs b/src/Nixfmt/Pretty.hs index dd95e186..8e6ae8b3 100644 --- a/src/Nixfmt/Pretty.hs +++ b/src/Nixfmt/Pretty.hs @@ -46,7 +46,7 @@ instance Pretty Trivium where pretty EmptyLine = emptyline pretty (LineComment c) = comment ("#" <> c) <> hardline pretty (BlockComment c) - | all ("*" `isPrefixOf`) (tail c) = hcat (map toLineComment' c) + -- | all ("*" `isPrefixOf`) (tail c) = hcat (map toLineComment' c) | otherwise = comment "/*" <> hardspace -- Add an offset to manually indent the comment by one diff --git a/test/diff/comment/out.nix b/test/diff/comment/out.nix index d3f0cf3d..a1322b5e 100644 --- a/test/diff/comment/out.nix +++ b/test/diff/comment/out.nix @@ -27,8 +27,9 @@ @ */ - # test - # test + /* test + * test + */ [ # 1