summary refs log tree commit diff stats
path: root/compiler/commands.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-01-29 03:08:41 +0100
committerAraq <rumpf_a@web.de>2015-01-29 03:08:41 +0100
commit8710a3738470e19e0d05c8e68db0803100caf3d8 (patch)
tree2169fe70ef9b4acf33379d5d6e33ffbd0c9d06ec /compiler/commands.nim
parentebda8e89e15e3af88822fb2dd57c108830609ec6 (diff)
downloadNim-8710a3738470e19e0d05c8e68db0803100caf3d8.tar.gz
nimsuggest: sane dirty buffer handling
Diffstat (limited to 'compiler/commands.nim')
-rw-r--r--compiler/commands.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/commands.nim b/compiler/commands.nim
index a438ea566..78fa9249c 100644
--- a/compiler/commands.nim
+++ b/compiler/commands.nim
@@ -252,10 +252,11 @@ proc trackDirty(arg: string, info: TLineInfo) =
   if parseUtils.parseInt(a[3], column) <= 0:
     localError(info, errInvalidNumber, a[2])
   
-  gDirtyBufferIdx = a[0].fileInfoIdx
-  gDirtyOriginalIdx = a[1].fileInfoIdx
- 
-  gTrackPos = newLineInfo(gDirtyBufferIdx, line, column)
+  let dirtyOriginalIdx = a[1].fileInfoIdx
+  if dirtyOriginalIdx >= 0:
+    msgs.setDirtyFile(dirtyOriginalIdx, a[0])
+
+  gTrackPos = newLineInfo(dirtyOriginalIdx, line, column)
 
 proc track(arg: string, info: TLineInfo) = 
   var a = arg.split(',')