diff --git a/Language/Haskell/Tools/PrettyPrint.hs b/Language/Haskell/Tools/PrettyPrint.hs
--- a/Language/Haskell/Tools/PrettyPrint.hs
+++ b/Language/Haskell/Tools/PrettyPrint.hs
@@ -97,7 +97,7 @@
   = let ls = splitOn "\n" s
      in case ls of _:_:_ -> (unlines (init ls) ++)
                               `mapFst` untilReaches' (last ls) (advanceSrcLoc start '\n') end
-                   _ -> (s, srcLocCol start)
+                   _ -> (s, srcLocCol $ foldl advanceSrcLoc start s)
   where
     untilReaches' [] curr _ = ([], srcLocCol curr)
     untilReaches' (c:rest) curr until | srcLocCol advancedLoc <= srcLocCol until
diff --git a/Language/Haskell/Tools/Transform.hs b/Language/Haskell/Tools/Transform.hs
--- a/Language/Haskell/Tools/Transform.hs
+++ b/Language/Haskell/Tools/Transform.hs
@@ -9,7 +9,7 @@
   , sourceTemplateNodeRange, sourceTemplateNodeElems
   , sourceTemplateListRange, srcTmpListBefore, srcTmpListAfter, srcTmpDefaultSeparator, srcTmpIndented, srcTmpSeparators
   , sourceTemplateOptRange, srcTmpOptBefore, srcTmpOptAfter
-  , SourceTemplateElem(..), sourceTemplateTextElem, sourceTemplateTextRange, SourceTemplateTextElem(..), sourceTemplateText, isStayingText
+  , SourceTemplateElem(..), sourceTemplateTextElem, sourceTemplateTextRange, SourceTemplateTextElem(..), sourceTemplateText, lineEndings, isStayingText
   -- parts of the transformation, used for debugging purposes
   , rangeToSource, fixRanges, cutUpRanges, getLocIndices, mapLocIndices, fixMainRange, extractStayingElems
   ) where
diff --git a/Language/Haskell/Tools/Transform/PlaceComments.hs b/Language/Haskell/Tools/Transform/PlaceComments.hs
--- a/Language/Haskell/Tools/Transform/PlaceComments.hs
+++ b/Language/Haskell/Tools/Transform/PlaceComments.hs
@@ -41,7 +41,7 @@
               -> Ann UModule dom stage -> Ann UModule dom stage
 placeComments tokens comms mod
   = resizeAnnots (Set.filter (\rng -> srcSpanStart rng /= srcSpanEnd rng) $ Set.fromList $ concat (Map.elems tokens))
-      (concatMap (map nextSrcLoc . snd) (Map.toList comms)) mod
+      (concatMap (map nextSrcLoc . snd) (Map.toList cleanedComments)) mod
   where spans = allElemSpans mod
         sortedElemStarts = Set.fromList $ map srcSpanStart spans
         sortedElemEnds = Set.fromList $ map srcSpanEnd spans
@@ -49,6 +49,12 @@
           = let after = fromMaybe noSrcLoc (Set.lookupLE (srcSpanStart sp) sortedElemEnds)
                 before = fromMaybe noSrcLoc (Set.lookupGE (srcSpanEnd sp) sortedElemStarts)
              in ((after,before),comm)
+        cleanedComments = Map.map (map cleanComment) comms
+        cleanComment (L loc (AnnLineComment txt))
+          | last txt `elem` "\n\r" = L (mkSrcSpan (srcSpanStart loc) (decreaseCol (srcSpanEnd loc))) (AnnLineComment (init txt))
+        cleanComment c = c
+        decreaseCol (RealSrcLoc l) = mkSrcLoc (srcLocFile l) (srcLocLine l) (srcLocCol l - 1)
+        decreaseCol l = l
 
 allElemSpans :: (SourceInfoTraversal node, RangeInfo stage) => Ann node dom stage -> [SrcSpan]
 allElemSpans = execWriter . sourceInfoTraverse (SourceInfoTrf (\ni -> tell [ni ^. nodeSpan] >> pure ni) pure pure)
diff --git a/Language/Haskell/Tools/Transform/RangeTemplateToSourceTemplate.hs b/Language/Haskell/Tools/Transform/RangeTemplateToSourceTemplate.hs
--- a/Language/Haskell/Tools/Transform/RangeTemplateToSourceTemplate.hs
+++ b/Language/Haskell/Tools/Transform/RangeTemplateToSourceTemplate.hs
@@ -88,9 +88,11 @@
           breakStaying = concat . Prelude.map (\(NormalText s) -> toTxtElems s)
 
           toTxtElems :: String -> [SourceTemplateTextElem]
-          toTxtElems = extractStaying . splitOn "\n"
-          extractStaying lines = Prelude.foldr appendTxt []
-                                   $ Prelude.map (\ln -> if "#" `isPrefixOf` ln then StayingText ln "\n" else NormalText ln) lines
+          toTxtElems str = extractStaying $ splitOn "\n" $ str
+            where
+              extractStaying lines | not (any ("#" `isPrefixOf`) lines) = [NormalText str]
+              extractStaying lines = Prelude.foldr appendTxt []
+                                       $ Prelude.map (\ln -> if "#" `isPrefixOf` ln then StayingText ln "\n" else NormalText ln) lines
           -- recombines the lines if they are both normal text
           -- otherwise it moves the windows '\r' characters to the correct position
           appendTxt (NormalText n1) (NormalText n2 : rest) = NormalText (n1 ++ '\n':n2) : rest
diff --git a/haskell-tools-prettyprint.cabal b/haskell-tools-prettyprint.cabal
--- a/haskell-tools-prettyprint.cabal
+++ b/haskell-tools-prettyprint.cabal
@@ -1,5 +1,5 @@
 name:                haskell-tools-prettyprint
-version:             0.7.0.0
+version:             0.8.0.0
 synopsis:            Pretty printing of Haskell-Tools AST
 description:         Converts the Haskell-Tools AST to text. Prepares the AST for this conversion. If the AST was created from the GHC AST this pretty printing will result in the original source code. Generated AST parts will get the default formatting. Works using the source annotations that are present in the AST. Creates a rose tree first to simplify the conversion.
 homepage:            https://github.com/haskell-tools/haskell-tools
@@ -31,5 +31,5 @@
                      , split             >= 0.2  && < 0.3
                      , text              >= 1.2  && < 1.3
                      , ghc               >= 8.0  && < 8.1
-                     , haskell-tools-ast >= 0.7  && < 0.8
+                     , haskell-tools-ast >= 0.8  && < 0.9
   default-language: Haskell2010
