@@ -27,6 +27,7 @@ import qualified GHC
2727import qualified Lexer as GHC
2828import Ormolu.Parser.Pragma
2929import Ormolu.Parser.Shebang
30+import Ormolu.Processing.Common
3031import Ormolu.Utils (showOutputable)
3132import SrcLoc
3233
@@ -109,11 +110,15 @@ mkComment ls (L l s) = (ls', comment)
109110 Nothing -> s :| []
110111 Just (x :| xs) ->
111112 let getIndent y =
112− if all isSpace y
113+ if all isSpace y || y == endDisabling
113114 then startIndent
114115 else length (takeWhile isSpace y)
115116 n = minimum (startIndent : fmap getIndent xs)
116− in x :| (drop n <$> xs)
117+ removeIndent y =
118+ if y == endDisabling
119+ then y
120+ else drop n y
121+ in x :| (removeIndent <$> xs)
117122 else s :| []
118123 (atomsBefore, ls') =
119124 case dropWhile ((< commentLine) . fst) ls of