diff options
author | Araq <rumpf_a@web.de> | 2015-04-30 00:01:07 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-04-30 00:01:07 +0200 |
commit | d40098ad8259880d59dfc5dab895912f434d6cbd (patch) | |
tree | 04f96f12182177fba0485a2e204849fb460d8093 | |
parent | 6d05ae26e66189c72af64f9ade054f9686e004be (diff) | |
download | Nim-d40098ad8259880d59dfc5dab895912f434d6cbd.tar.gz |
columns are 1 based for nimsuggest
-rw-r--r-- | compiler/nimsuggest/nimsuggest.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/nimsuggest/nimsuggest.nim b/compiler/nimsuggest/nimsuggest.nim index b45ca475c..8285d81d9 100644 --- a/compiler/nimsuggest/nimsuggest.nim +++ b/compiler/nimsuggest/nimsuggest.nim @@ -82,7 +82,8 @@ proc action(cmd: string) = if cmd[i] == ';': i = parseQuoted(cmd, dirtyfile, i+1) i += skipWhile(cmd, seps, i) - var line, col = -1 + var line = -1 + var col = 0 i += parseInt(cmd, line, i) i += skipWhile(cmd, seps, i) i += parseInt(cmd, col, i) @@ -97,7 +98,7 @@ proc action(cmd: string) = resetModule dirtyIdx if dirtyIdx != gProjectMainIdx: resetModule gProjectMainIdx - gTrackPos = newLineInfo(dirtyIdx, line, col) + gTrackPos = newLineInfo(dirtyIdx, line, col-1) #echo dirtyfile, gDirtyBufferIdx, " project ", gProjectMainIdx gErrorCounter = 0 if not isKnownFile: @@ -150,11 +151,11 @@ proc mainCommand = proc processCmdLine*(pass: TCmdLinePass, cmd: string) = var p = parseopt.initOptParser(cmd) - while true: + while true: parseopt.next(p) case p.kind - of cmdEnd: break - of cmdLongoption, cmdShortOption: + of cmdEnd: break + of cmdLongoption, cmdShortOption: case p.key.normalize of "port": gPort = parseInt(p.val).Port of "address": gAddress = p.val |