[bugfix] fix nimpretty for absolute paths (#11480)

(cherry picked from commit da035e9c83)
This commit is contained in:
Jasper Jenkins
2019-06-12 02:59:26 -07:00
committed by narimiran
parent 9797da3615
commit 6530a4100a

View File

@@ -49,7 +49,9 @@ type
proc prettyPrint(infile, outfile: string, opt: PrettyOptions) =
var conf = newConfigRef()
let fileIdx = fileInfoIdx(conf, AbsoluteFile infile)
conf.outFile = RelativeFile outfile
let f = splitFile(outfile.expandTilde)
conf.outFile = RelativeFile f.name & f.ext
conf.outDir = toAbsoluteDir f.dir
var p: TParsers
p.parser.em.indWidth = opt.indWidth
if setupParsers(p, fileIdx, newIdentCache(), conf):