From afbc7869a7d80537ed5fa7eb87427caac321f294 Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Mon, 9 Jun 2014 10:03:40 -0700 Subject: [PATCH] Fix off-by-one error with location list diags --- python/ycm/vimsupport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ycm/vimsupport.py b/python/ycm/vimsupport.py index dde51e60..db7003ce 100644 --- a/python/ycm/vimsupport.py +++ b/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