[bugfix] fix nimpretty for absolute paths (#11480)
This commit is contained in:
parent
b056d32a79
commit
da035e9c83
1 changed files with 3 additions and 1 deletions
|
|
@ -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):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue