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

This commit is contained in:
Jasper Jenkins 2019-06-12 02:59:26 -07:00 • committed by Miran
commit da035e9c83

View file

@ -49,7 +49,9 @@ type
proc prettyPrint(infile, outfile: string, opt: PrettyOptions) = proc prettyPrint(infile, outfile: string, opt: PrettyOptions) =
var conf = newConfigRef() var conf = newConfigRef()
let fileIdx = fileInfoIdx(conf, AbsoluteFile infile) 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 var p: TParsers
p.parser.em.indWidth = opt.indWidth p.parser.em.indWidth = opt.indWidth
if setupParsers(p, fileIdx, newIdentCache(), conf): if setupParsers(p, fileIdx, newIdentCache(), conf):