summary refs log tree commit diff stats
path: root/nimsuggest/nimsuggest.nim
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2019-06-17 20:41:41 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-06-17 20:41:41 +0200
commit6cad5c78618ad7c35147f24d35febeee124b015d (patch)
tree35fad317390045286b772919aa960e511ab439cd /nimsuggest/nimsuggest.nim
parentb70fd0400eb976b7e1e60845b2bfe0bdb5bf137e (diff)
downloadNim-6cad5c78618ad7c35147f24d35febeee124b015d.tar.gz
[bugfix] fix #11482, fix nimsuggest range error (#11519)
The default starting parameters for `line` and `col` were switched.

See line 141: "line starts at 1, column at 0, dirtyfile is optional".
Also, in `TLineInfo` object, `line` is uint16, `col` is int16.
Diffstat (limited to 'nimsuggest/nimsuggest.nim')
-rw-r--r--nimsuggest/nimsuggest.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/nimsuggest/nimsuggest.nim b/nimsuggest/nimsuggest.nim
index 98e2d89c3..299f68352 100644
--- a/nimsuggest/nimsuggest.nim
+++ b/nimsuggest/nimsuggest.nim
@@ -445,8 +445,8 @@ proc execCmd(cmd: string; graph: ModuleGraph; cachedMsgs: CachedMsgs) =
     if i < cmd.len and cmd[i] == ';':
       i = parseQuoted(cmd, dirtyfile, i+1)
     i += skipWhile(cmd, seps, i)
-  var line = -1
-  var col = 0
+  var line = 0
+  var col = -1
   i += parseInt(cmd, line, i)
   i += skipWhile(cmd, seps, i)
   i += parseInt(cmd, col, i)