瀏覽代碼

Fix off-by-one error with location list diags

Strahinja Val Markovic 10 年之前
父節點
當前提交
afbc7869a7
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      python/ycm/vimsupport.py

+ 2 - 2
python/ycm/vimsupport.py

@@ -206,7 +206,7 @@ def ConvertDiagnosticsToQfList( diagnostics ):
     # line/column numbers are 1 or 0 based in its various APIs. Here, it wants
     # them to be 1-based.
     location = diagnostic[ 'location' ]
-    line_num = location[ 'line_num' ] + 1
+    line_num = location[ 'line_num' ]
 
     # libclang can give us diagnostics that point "outside" the file; Vim borks
     # on these.
@@ -216,7 +216,7 @@ def ConvertDiagnosticsToQfList( diagnostics ):
     return {
       'bufnr' : GetBufferNumberForFilename( location[ 'filepath' ] ),
       'lnum'  : line_num,
-      'col'   : location[ 'column_num' ] + 1,
+      'col'   : location[ 'column_num' ],
       'text'  : ToUtf8IfNeeded( diagnostic[ 'text' ] ),
       'type'  : diagnostic[ 'kind' ][ 0 ],
       'valid' : 1