[backport] fix nimpretty removing space before pragma

This commit is contained in:
narimiran 2019-09-27 10:36:22 +02:00
commit f804245087

View file

@ -499,7 +499,8 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
rememberSplit(splitComma) rememberSplit(splitComma)
wrSpace em wrSpace em
of openPars: of openPars:
if tok.strongSpaceA > 0 and not em.endsInWhite and not em.wasExportMarker: if tok.strongSpaceA > 0 and not em.endsInWhite and
(not em.wasExportMarker or tok.tokType == tkCurlyDotLe):
wrSpace em wrSpace em
wr(em, TokTypeToStr[tok.tokType], ltSomeParLe) wr(em, TokTypeToStr[tok.tokType], ltSomeParLe)
rememberSplit(splitParLe) rememberSplit(splitParLe)