improvements for nimfix

This commit is contained in:
Araq 2014-09-17 01:45:27 +02:00
commit 611d5d7766
3 changed files with 41 additions and 27 deletions

View file

@ -15,6 +15,7 @@ type
lines*: seq[string]
dirty*, isNimfixFile*: bool
fullpath*, newline*: string
fileIdx*: int32
var
gSourceFiles*: seq[TSourceFile] = @[]
@ -24,6 +25,7 @@ proc loadFile*(info: TLineInfo) =
if i >= gSourceFiles.len:
gSourceFiles.setLen(i+1)
if gSourceFiles[i].lines.isNil:
gSourceFiles[i].fileIdx = info.fileIndex
gSourceFiles[i].lines = @[]
let path = info.toFullPath
gSourceFiles[i].fullpath = path